上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页

2025年2月4日

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年2月2日

组件全局注册和递归调用

摘要: import { createApp } from 'vue' import './style.css' import App from './App.vue' import SelfComponent from './study/selfComponent/component.vue' const 阅读全文

posted @ 2025-02-02 20:09 ChoZ 阅读(1) 评论(0) 推荐(0) 编辑

defineProps,defineEmits,defineExport

摘要: <template> <PropsEmitExport ref="propsEmitExportRef" :father="'标题'" @toFatherEmit="getChildData" @toFastherEmits="getChildDataTwo"></PropsEmitExport> 阅读全文

posted @ 2025-02-02 19:21 ChoZ 阅读(2) 评论(0) 推荐(0) 编辑

bem函数

摘要: $name-space: 'study-7bem'; // 例如element的类名中都有el $block-sel: '-'; // 例如el-中的- $element-sel: '———'; //例如element中对元素添加类名的时候使用的是——— $modfier-sle: '--'; // 阅读全文

posted @ 2025-02-02 16:47 ChoZ 阅读(1) 评论(0) 推荐(0) 编辑

2025年1月31日

生命周期

摘要: main.vue <template> <div @click="isShow">显隐</div> <componentA v-if="!flag"></componentA> </template> <script setup lang='ts'> import { ref } from 'vue 阅读全文

posted @ 2025-01-31 17:39 ChoZ 阅读(2) 评论(0) 推荐(0) 编辑

watchEffect

摘要: <template> <div> <input type="text" v-model="name" /> <div id="beWatch"></div> <!-- <button @click="stopEffect">停止</button> --> </div> </template> <sc 阅读全文

posted @ 2025-01-31 16:19 ChoZ 阅读(3) 评论(0) 推荐(0) 编辑

watch

摘要: <template> <div> <input type="text" v-model="name" /> <input type="text" v-model="obj.age" /> <input type="text" v-model="refName.age" /> </div> </tem 阅读全文

posted @ 2025-01-31 15:45 ChoZ 阅读(6) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页

导航

< 2025年2月 >
26 27 28 29 30 31 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 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示