Skip to main content

Extension

FPI.extension.register

FPI.extension.register('#countdown-timer', {
created(){
// ....
},
mounted(...rest) {
// ....
},
updated(...rest) {
// ....
},
destroyed(){
// ....
},
watch: {
route(...rest){
// ....
}
}
});

Hook Functions

A register definition object can provide several hook functions (all optional):

created: called only once, when the directive is first bound to the element. This is where you can do one-time setup work.

mounted: called when the bound element has been inserted into its parent node (this only guarantees parent node presence, not necessarily in-document).

updated: called after the containing component’s VNode and the VNodes of its children have been updated. The directive’s value may or may not have changed, but you can skip unnecessary updates by comparing the binding’s current and old values (see below on hook arguments).

destroyed: called only once, when the directive is unbound from the element.

watch.route: called when the element is still mounted and the routes have changed.


Was this section helpful?