2025年2月4日

keepAlive

摘要: <template> include是指缓存的组件,如果不写,则所有组件都会被缓存 exclude是指不缓存的组件,如果不写,则所有组件都会被缓存 <keep-alive include="A"> <A v-if="showA" /> <B v-else /> </keep-alive> <butt 阅读全文

posted @ 2025-02-04 22:49 ChoZ 阅读(7) 评论(0) 推荐(0) 编辑

teleport

摘要: <template> <div class="warp"> // body是指将teleport组件挂载到body上,to可以写元素名/类名/ID名 <teleport to='body'> <TeleportComponent /> </teleport> </div> </template> < 阅读全文

posted @ 2025-02-04 22:23 ChoZ 阅读(4) 评论(0) 推荐(0) 编辑

异步组件defineAsyncComponent - 骨架屏

摘要: <template> 实现骨架屏效果 <Suspense> <template #default> <sync /> </template> <template #fallback> <skeleton /> </template> </Suspense> </template> <script s 阅读全文

posted @ 2025-02-04 21:48 ChoZ 阅读(3) 评论(0) 推荐(0) 编辑

slot全家桶

摘要: <template> <SlotComponent> <!-- <template v-slot>123</template> --> <template #default>不同写法</template> <!-- <template v-slot:middle>456</template> --> 阅读全文

posted @ 2025-02-04 17:38 ChoZ 阅读(2) 评论(0) 推荐(0) 编辑

component的is写法优化

摘要: <template> <component :is='component'></component> </template> <script setup lang='ts'> import { ref, shallowRef } from 'vue' import A from './A.vue' 阅读全文

posted @ 2025-02-04 16:38 ChoZ 阅读(3) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示