https://cn.vuejs.org/v2/api/#data
import Child from './Child.vue'
export default {
name: 'HelloWorld',
data() {
return {
msg: 'Welcome to Your Vue.js App'
}
},
props: [
'input'
],
components: {
Child
},
computed: {
mmm: {
get: function () {
return this.msg
},
set: function (value) {
this.msg = value
}
}
},
methods: {
mm: function () {
this.mmm = 5
}
},
watch: {
msg: function (newValue, oldValue) {
console.log('new: %s, old: %s', newValue, oldValue)
}
},
created: function () {
this.mm()
}
}