Declare multiple name in the vue component

Hello, everyone. I have just come into contact with vue and feel that using export in a vue component does not seem to be able to declare multiple name. I can"t describe it clearly. Just look at the code
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 "
}

}
}

at this time, the console mistakenly reported that there could not be two "name"" data"

.
Mar.23,2021

es6 syntax variables cannot be declared repeatedly


https://cn.vuejs.org/v2/api/-sharp.
https://cn.vuejs.org/v2/api/-sharp.
official website After reading it, you will know why

Menu