Props, setup, v-model, computed in Vue3
props
https://v3.vuejs.org/guide/component-props.html#prop-validation
Setup
https://v3.vuejs.org/guide/composition-api-setup.html#context
v-model
https://learnvue.co/2021/01/everything-you-need-to-know-about-vue-v-model/
https://v3.vuejs.org/guide/migration/v-model.html#v-model-arguments
computed
https://stackoverflow.com/a/64777336
watch
https://v3.vuejs.org/api/computed-watch-api.html#watching-a-single-source
reactive or ref?
https://stackoverflow.com/questions/64926354/vue-3-watch-doesn-t-work-if-i-watch-a-destructured-prop
It seems like reactive
and refs
are different things
watch
function can watch refs props
but not reactive props
damn it, why there are no docs on their official website
watch(
() => props.message,
(_newValue, _oldValue) => {
console.log(_newValue, _oldValue);
},
{
deep: true,
}
);