摘要:
父向子传递 // 父组件 <Child title="我是父组件的标题" :list="[1,2,3]" /> // 子组件接收 import { ref } from "vue"; type Props = { title: string; list: number[]; data?: numbe 阅读全文
posted @ 2022-11-01 19:10
前端之旅
阅读(35)
评论(0)
推荐(0)
摘要:
vue3生命周期 import { onBeforeMount, onBeforeUnmount, onBeforeUpdate, onMounted, onRenderTracked, onRenderTriggered, onUnmounted, onUpdated, } from "vue"; 阅读全文
posted @ 2022-11-01 18:26
前端之旅
阅读(40)
评论(0)
推荐(0)
摘要:
computed import { computed, ref } from "vue"; const firstName = ref(""); const lastName = ref(""); const name = computed(() => firstName.value + lastN 阅读全文
posted @ 2022-11-01 18:04
前端之旅
阅读(29)
评论(0)
推荐(0)
摘要:
// 只能修改响应式对象的值 const person = reactive({ name: "zhangsan", age: 18 }); // 将age属性单独提出来响应式数据 const ageCopy = toRef(person, "age"); const change = () => 阅读全文
posted @ 2022-11-01 17:15
前端之旅
阅读(17)
评论(0)
推荐(0)