Vue3
composition API
export default {
setup() {
const prop = ref('')
const fn = () => {
}
return { prop, fn }
}
}<div ref="dom">我是DOM</dov> <script setup> //必须跟上面的名字一样 const dom = ref() console.log(dom.value) </script><script setup lang="js"> let obj = reactive({a: '1'}) const handleChangeObj = () => { //以下非响应式 obj = reactive({...obj, b: '2'}) obj = {...obj, b: '2'} //以下响应式 obj.b = '2' Object.assign(obj, {b: '2'}) } </script>
key-diff解析
Vue3响应式简易实现


生命周期

组件


v-model
Directive
自定义Hooks
全局函数、变量
css Style
others
Last updated
