摘要: 1. 子组件间通信(defineEmits + defineProps) 1.1 实现效果 在一个子组件的输入框中输入数据, 在另一个子组件上显示. 如下图: 1.2 defineEmits 和 defineProps 的 TS 使用 1.2.1 defineEmits 的 TS 使用 export 阅读全文
posted @ 2023-03-26 20:55 小阁下 阅读(163) 评论(1) 推荐(0) 编辑
摘要: 1. typeof 1.1 typeof 的类型守卫用法 在类型代码中, typeof 执行的是最窄推导程度, 具体如下 const str = '123' type type1 = typeof str // '123' 通过类型推导, 可以达到收窄变量类型的目的 const foo = (inp 阅读全文
posted @ 2023-03-26 16:12 小阁下 阅读(80) 评论(0) 推荐(0) 编辑