refactor: use nuxt-class-component in example

This commit is contained in:
Clark Du 2017-10-23 17:27:30 +08:00
parent d5837a7c47
commit 407569480b
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9
3 changed files with 2 additions and 18 deletions

View File

@ -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'
} }
} }
} }

View File

@ -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",

View File

@ -1,14 +0,0 @@
import Component from 'vue-class-component'
Component.registerHooks([
'beforeRouteEnter',
'beforeRouteLeave',
'asyncData',
'fetch',
'middleware',
'layout',
'transition',
'scrollToTop'
])
export default Component