1.basic.js
const = vue;
createApp(App).mount("#app");
2.setup.js
const App = {
template:``,
setup(){}
}
*3.reactive.js
原来的data,对一个对象进行可观测,函数式api 灵活
*4.ref.js
2.0 对dom节点指定,使用时用this.$refs.xxx拿到
const count = ref(0)/useState(0) 创建可观察某个元素
toRefs 解构
interface Ref
function ref
const foo = ref<string | number>('foo')
foo.value = 123;
5.computed.js
6.readonly.js
7.watch.js
8.watchEffect.js
9.lifyStyle.js
10.provider@ inject.js
2.0 const s =symbol();
provider = {
return{
[s]:"foo",
}
}
child = {
inject:
}
11.templateRefs.js
const root = ref(null);
onMounted(()=>{
console.log(root.value)
});
return{
root,
}
12.defineComponent.js
13.newFeature.js
评论区