随笔分类 -  vue

摘要:效果与a标签的target=_blank是一样的,只不过不用点击,直接打开 1、在router.js里新加一个页面路由 { path: '/helloWorld', name: 'HelloWorld', component: () => import('../components/HelloWor 阅读全文
posted @ 2021-03-11 15:15 小生不才。 阅读(3028) 评论(0) 推荐(0)
摘要:在main.js里加指令 //创建自定义指令 v-downVue.directive('down', { inserted: (el, binding) => { el.style.cssText = 'cursor: pointer;color:write;' el.addEventListene 阅读全文
posted @ 2021-03-11 14:34 小生不才。 阅读(4322) 评论(0) 推荐(0)
摘要:原理分析与实现 1、动态切换class 【 :class="[showPage == index ? 'act' : '']" 】 2、v-show,根据表达式的真假值,切换元素的display属性 【 v-show="showPage == index" 】 下面进入正题 完整代码 HTML部分 阅读全文
posted @ 2020-12-22 10:03 小生不才。 阅读(227) 评论(0) 推荐(0)