Closed
Description
There is many fields in vue instance/component where we can specify properties visible inside component, data
, props
, computed
, methods
.
Invalid Code:
export default {
props: ['foo'],
props: {
foo: String
},
computed: {
foo () {
}
},
data() {
return {
foo: null
}
},
data: {
foo: null
},
methods: {
foo () {
}
}
}
Also there is few reserved names witch should not be overridden by vue instance:
- properties:
$data
,$props
,$el
,$options
,$parent
,$root
,$children
,$slots
,$scopedSlots
,$refs
,$isServer
,$attrs
,$listeners
- methods:
$watch
,$set
,$delete
,$on
,$once
,$off
,$emit
,$mount
,$forceUpdate
,$nextTick
,$destroy
.....
also user should be able to specify his own reserved names to remove conflicts with used plugins.