When I have a Vue.js component, it might look like this:
import Icon from './Components/Icon.vue'
export default {
props: {
data: {type: Object}
},
data() {
return {
label: this.data.label || '',
icon: this.data.icon || '',
placeholder: this.data.placeholder || '',
value: this.data.value || '',
disabled: this.data.disabled || false,
readOnly: this.data.readOnly || false,
options: this.data.options || []
}
},
components: {
Icon: Icon
}
}
How does the namespace work in Vue? Will the property keys, keys of return objects, and keys of objects of all components be added to the instance this? Is there a risk for errors / rewriting?
So, if I override this.data, can I read the original value I got in props?
What is the community’s practice for setting default values in a state object data, starting with props, so we can have a dynamic object stateand save propsthere, if necessary
: pass props v-bind watch ? , props , ?
.