大家好 我刚刚接触vue 感觉在一个vue组件当中 使用export 好像不能声明多个name。我描述不清 直接看代码吧
export default {
name: 'HelloWorld',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
},
name: 'showTest',
data () {
return {
msg2: 'this is only a test',
state: 'is it success ?'
}
},
methods: {
details: function () {
return this.state + ' you are right '
}
}
}
这时候控制台报错 说不能有两个 ‘name’ 两个‘data’
es6语法变量不能重复声明