摘要: 此方法可以封装自己的组件库 在src目录下新建modules-->index.js + components 文件夹 index.js 文件内容如下 // 导入组件 import YyButtons from './components/yy-button.vue' import YyInput f 阅读全文
posted @ 2022-01-09 18:44 YAN-YAN 阅读(324) 评论(0) 推荐(0)
摘要: vue中使用异步组件的步骤 在components属性中引入组件 在template中使用组件 <template> <div id="app"> <div> <h1> Vue中异步组件的使用 </h1> <button @click="show = !show"> 切换组件 </button> < 阅读全文
posted @ 2022-01-09 12:53 YAN-YAN 阅读(477) 评论(0) 推荐(1)
摘要: 在组件中有定时器任务时,当组件销毁之后定时器任务依然执行,可在destoryed()钩子函数中清除掉 <template> <div> <swiper-destoryed v-if="show"></swiper-destoryed> <button @click="show = false">注销 阅读全文
posted @ 2022-01-09 10:26 YAN-YAN 阅读(260) 评论(0) 推荐(0)