সম্পাদনা
<!DOCTYPE html> <html> <body> <div id="app"> <child-component></child-component> <p>{{error}}</p> </div> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script> const {createApp, ref, onErrorCaptured} = Vue; const ChildComponent = { setup() { throw new Error("এরর"); }, template: "<p>হ্যালো</p>" }; createApp({ components: {ChildComponent}, setup() { const error = ref(""); onErrorCaptured((err) => { error.value = err.message; return false; }); return {error}; } }).mount("#app"); </script> </body> </html>
পূর্বরূপ