当前位置: 首页 > news >正文

网站开发现在是热门专业吗百度官方网址

网站开发现在是热门专业吗,百度官方网址,合山网站建设,网站开发+百度编辑器在Vue中,通过使用动态组件,我们可以实现组件的动态切换,从而达到页面的动态展示效果。 vue 中 component组件 is属性 功能描述 例如:有多个tabs标签,如:推荐、热点、视频等。用户点击标签就会切换到对应组…

在Vue中,通过使用动态组件,我们可以实现组件的动态切换,从而达到页面的动态展示效果。

vue 中 component组件 is属性

 功能描述 

例如:有多个tabs标签,如:推荐、热点、视频等。用户点击标签就会切换到对应组件

vue2版

<template><!-- 标签数据 --><!-- uview-ui 标签组件 --><u-tabsclass="tabsBox":list="tabData"@click="changeTab":current="tabsCurrent"></u-tabs><!-- 组件切换 --><component :is="getCurrentCompName"></component>
</template><script>
import CompA from './components/comp-a.vue'
import CompB from './components/comp-b.vue'
import CompC from './components/comp-c.vue'export default {data() {return {tabsCurrent: 0,tabsList: [],}},computed: {getCurrentCompName() {let currentCompName = ''switch (this.tabsCurrent) {case 1:currentCompName = 'CompB'breakcase 2:currentCompName = 'CompC'breakdefault:currentCompName = 'CompA'}return currentCompName},},methods: {toggle(index) {this.tabsCurrent = index},},
}
</script>

vue3版

<template><!-- 标签数据 --><!-- uview-ui 标签组件 --><u-tabsclass="tabsBox":list="tabData"@click="changeTab":current="tabsCurrent"></u-tabs><!-- 组件切换 --><component :is="getCurrentCompName"></component>
</template><script setup>
import { ref, reactive, markRaw} from 'vue';
import CompA from './components/comp-a.vue';
import CompB from './components/comp-b.vue';
import CompC from './components/comp-c.vue';const tabsCurrent = ref(0);
const tabsList = ref([]);const getCurrentCompName = () => {let currentCompName = '';switch (tabsCurrent.value) {case 1:currentCompName = markRaw(CompB);break;case 2:currentCompName = markRaw(CompC);break;default:currentCompName = markRaw(CompA);}return currentCompName;
};const toggle = (index) => {tabsCurrent.value = index;
};
</script>

或者

<template><!-- 标签数据 --><!-- uview-ui 标签组件 --><u-tabsclass="tabsBox":list="tabData"@click="changeTab":current="tabsCurrent"></u-tabs><!-- 组件切换 --><component :is="currentComp"></component>
</template><script setup>
import { ref, reactive, markRaw, shallowRef } from 'vue';
import CompA from './components/comp-a.vue';
import CompB from './components/comp-b.vue';
import CompC from './components/comp-c.vue';const tabsCurrent = ref(0);
const tabsList = ref([]);
const currentComp = shallowRef(CompA)const toggle = (index) => {tabsCurrent.value = index;switch (index) {case 1:currentComp.value = CompB;break;case 2:currentComp.value = CompC;break;default:currentComp.value = CompA;}
};
</script>
http://www.hkea.cn/news/881998/

相关文章:

  • 平阴县建设工程网站直通车推广怎么做
  • 网站开发外包不给ftp高佣金app软件推广平台
  • 太原适合网站设计地址百度用户服务中心客服电话
  • 济南源码网站建设长沙网站seo推广公司
  • 北京网站制作17页和业务多一样的平台
  • 无锡市住房城乡建设委网站简单网页设计模板html
  • 武汉市大型的网站制作公司网站ip查询
  • 做仪表行业推广有哪些网站电商网站设计
  • 动静分离网站架构百度售后客服电话24小时
  • 做汽车配件生意的网站佛山seo关键词排名
  • 创意建站推荐百度做广告多少钱一天
  • 巴中网站建设公司百度seo怎么做网站内容优化
  • 查网站备案名称上海网络营销seo
  • 人是用什么做的视频网站网络营销方案设计毕业设计
  • 建设网站考虑因素关键词优化是怎么弄的
  • 陕西营销型网站建设推广普通话的内容简短
  • 做配电箱的专门网站百度指数属于行业趋势及人群
  • 学做网站的网站重庆seo整站优化报价
  • 保定网站设计概述seo推广软件排名
  • 查pv uv的网站网络营销推广服务
  • 怎样让客户做网站优化 保证排名
  • 企业营销型网站做的好网络营销的有哪些特点
  • 网站开发 合同兰州快速seo整站优化招商
  • 网站开发技术现状深圳网络营销推广培训
  • 知名网络公司有哪些河北网站seo
  • 学做网站多少钱关键词难易度分析
  • 传奇如何做网站网站建设策划书案例
  • 龙岗 网站建设深圳信科最好用的搜索神器
  • 动态网站开发日志重庆seo整站优化报价
  • 魔站网站建设微信公众号运营推广方案