From ef5bf395148b69d3c0ef17048ef6308157d7c8fe Mon Sep 17 00:00:00 2001 From: Aideen N Date: Fri, 13 Aug 2021 14:15:06 -0700 Subject: [PATCH] Fixed doc for Additional Hooks "vue-class-component" doesn't export `Component` any longer. I found that using `{ Vue }` instead works in this case. --- docs/guide/additional-hooks.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guide/additional-hooks.md b/docs/guide/additional-hooks.md index 9461d1e..628c7ab 100644 --- a/docs/guide/additional-hooks.md +++ b/docs/guide/additional-hooks.md @@ -1,13 +1,13 @@ # Additional Hooks -If you use some Vue plugins like [Vue Router](https://router.vuejs.org/), you may want class components to resolve hooks that they provide. In that case, `Component.registerHooks` allows you to register such hooks: +If you use some Vue plugins like [Vue Router](https://router.vuejs.org/), you may want class components to resolve hooks that they provide. In that case, `Vue.registerHooks` allows you to register such hooks: ```js // class-component-hooks.js -import Component from 'vue-class-component' +import { Vue } from 'vue-class-component' // Register the router hooks with their names -Component.registerHooks([ +Vue.registerHooks([ 'beforeRouteEnter', 'beforeRouteLeave', 'beforeRouteUpdate' @@ -56,4 +56,4 @@ new Vue({ el: '#app', render: h => h(App) }) -``` \ No newline at end of file +``` pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy