mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
refactor: use nuxt-class-component in example
This commit is contained in:
parent
d5837a7c47
commit
407569480b
@ -2,9 +2,6 @@ module.exports = {
|
|||||||
build: {
|
build: {
|
||||||
babel: {
|
babel: {
|
||||||
plugins: ['transform-decorators-legacy', 'transform-class-properties']
|
plugins: ['transform-decorators-legacy', 'transform-class-properties']
|
||||||
},
|
|
||||||
extend (config) {
|
|
||||||
config.resolve.alias['nuxt-class-component'] = '@/plugins/nuxt-class-component'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||||
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
||||||
"nuxt": "latest",
|
"nuxt": "latest",
|
||||||
"vue-class-component": "^5.0.1"
|
"nuxt-class-component": "^1.0.3",
|
||||||
|
"vue": "~2.4.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nuxt",
|
"dev": "nuxt",
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
import Component from 'vue-class-component'
|
|
||||||
|
|
||||||
Component.registerHooks([
|
|
||||||
'beforeRouteEnter',
|
|
||||||
'beforeRouteLeave',
|
|
||||||
'asyncData',
|
|
||||||
'fetch',
|
|
||||||
'middleware',
|
|
||||||
'layout',
|
|
||||||
'transition',
|
|
||||||
'scrollToTop'
|
|
||||||
])
|
|
||||||
|
|
||||||
export default Component
|
|
Loading…
Reference in New Issue
Block a user