Content deleted Content added
Add: journal, title. | Use this tool. Report bugs. | #UCB_Gadget |
m →In user interfaces: {{codett}} |
||
Line 48:
For example, in [[Vue.js]], a component would catch errors by implementing <code>errorCaptured</code>
{{pre|
<syntaxhighlight lang="vue">▼
{{codett|2=js|1=Vue.component('parent', {}}
{{codett|2=vue |template: '<div><slot></slot></div>',}}
{{codett|2=js|1=errorCaptured: (err, vm, info) => alert('An error occurred');}}
})
{{codett|2=js|1=Vue.component('child', {}}
{{codett|2=vue |template: '<div>{{((}} cause_error() {{))}}</div>'}}
})
}}
When used like this in markup:
<parent>
<child></child>
</parent>
</syntaxhighlight>
==See also==
|