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

外包程序开发 公司合肥seo整站优化

外包程序开发 公司,合肥seo整站优化,专业邯郸做网站,app下载安装免费使用场景: 多个组件通过component标签挂载在同一个组件中,通过触发时间进行动态切换。vue3与vue2用法不一样,这里有坑! 使用方法: 1.通过vue的defineAsyncComponent实现挂载组件 2.component中的is属性 父组件&am…

使用场景:

多个组件通过component标签挂载在同一个组件中,通过触发时间进行动态切换。vue3与vue2用法不一样,这里有坑!

使用方法:

1.通过vue的defineAsyncComponent实现挂载组件

2.component中的is属性

父组件:

<template><div><div v-for="item in person.data" :key="item" @click="btn(item)">{{ item.name }}</div><h1>下面为动态组件</h1><component :is="person.componen"> </component></div>
</template><script setup>
import { reactive, onMounted, defineAsyncComponent } from "vue";
const One = defineAsyncComponent(() => import("./One.vue"));
const Two = defineAsyncComponent(() => import("./Two.vue"));const person = reactive({componen: "",data: [{ type: "one", name: "显示组件一" },{ type: "two", name: "显示组件二" },],
});
function btn(item) {if (item.type == "one") person.componen = One;if (item.type == "two") person.componen = Two;
}onMounted(() => {});
</script>

子组件:

<template><div>组件一</div><el-input v-model="person.input"></el-input>
</template><script setup>
import { ref, reactive, onMounted, computed, watch } from "vue";const person = reactive({ input: "" });
onMounted(() => {console.log("组件一");
});
</script>
<style scoped lang='less'>
</style>

效果:

这里会有警告:Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`. (Vue收到一个组件,该组件被设置为反应对象。这可能会导致不必要的性能开销,应该通过用“markRaw”标记组件或使用“shallowRef”而不是“ref”来避免。)

        

解决方法:

1.使用shallowRef替换响应式

<template><div><div v-for="item in person.data" :key="item" @click="btn(item)">{{ item.name }}</div><h1>下面为动态组件</h1><keep-alive><component :is="componen"> </component></keep-alive></div>
</template><script setup>
import { reactive, onMounted, defineAsyncComponent, shallowRef } from "vue";
let componen = shallowRef(null);
const Two = defineAsyncComponent(() => import("./Two.vue"));
const One = defineAsyncComponent(() => import("./One.vue"));
let obj = shallowRef({Two,One,
});
const person = reactive({data: [{ type: "one", name: "显示组件一" },{ type: "two", name: "显示组件二" },],
});
function btn(item) {if (item.type == "one") componen.value = obj.value.One;if (item.type == "two") componen.value = obj.value.Two;
}onMounted(() => {});
</script>
<style scoped lang='less'>
</style>


文章转载自:
http://dinncodextrose.bkqw.cn
http://dinncoacoustoelectronics.bkqw.cn
http://dinncochlorite.bkqw.cn
http://dinncodilated.bkqw.cn
http://dinncoinerrancy.bkqw.cn
http://dinncorodingitize.bkqw.cn
http://dinncotrieste.bkqw.cn
http://dinncoochroid.bkqw.cn
http://dinncometamorphism.bkqw.cn
http://dinncoeloquently.bkqw.cn
http://dinncohypha.bkqw.cn
http://dinncodetchable.bkqw.cn
http://dinncoarmenia.bkqw.cn
http://dinncodhooti.bkqw.cn
http://dinncoemerita.bkqw.cn
http://dinncororty.bkqw.cn
http://dinncoathwarthawse.bkqw.cn
http://dinncorattlebox.bkqw.cn
http://dinncoestrogenic.bkqw.cn
http://dinncoendowmenfpolicy.bkqw.cn
http://dinncocapricornian.bkqw.cn
http://dinncoannual.bkqw.cn
http://dinncowoodcraft.bkqw.cn
http://dinncominitank.bkqw.cn
http://dinncoreclamation.bkqw.cn
http://dinncoviridian.bkqw.cn
http://dinncosomeway.bkqw.cn
http://dinncoregeneracy.bkqw.cn
http://dinncooccultism.bkqw.cn
http://dinncoregentship.bkqw.cn
http://dinnconautilus.bkqw.cn
http://dinncomaribor.bkqw.cn
http://dinncotiffany.bkqw.cn
http://dinncorelevance.bkqw.cn
http://dinncoscorbutus.bkqw.cn
http://dinncostaggery.bkqw.cn
http://dinncotattered.bkqw.cn
http://dinncopollinosis.bkqw.cn
http://dinncodephlogisticate.bkqw.cn
http://dinncocosmologist.bkqw.cn
http://dinncoapsidal.bkqw.cn
http://dinncomicrobalance.bkqw.cn
http://dinncorabbiter.bkqw.cn
http://dinncoghast.bkqw.cn
http://dinncobronchium.bkqw.cn
http://dinncojoltheaded.bkqw.cn
http://dinncocajole.bkqw.cn
http://dinncohath.bkqw.cn
http://dinncochabazite.bkqw.cn
http://dinncoarrive.bkqw.cn
http://dinncoaerodontia.bkqw.cn
http://dinncodolomitic.bkqw.cn
http://dinncolactoscope.bkqw.cn
http://dinncoexaminer.bkqw.cn
http://dinncoassonant.bkqw.cn
http://dinncoreduplicative.bkqw.cn
http://dinncooverpoise.bkqw.cn
http://dinncolacrimose.bkqw.cn
http://dinncoherry.bkqw.cn
http://dinncoantianginal.bkqw.cn
http://dinncocricoid.bkqw.cn
http://dinncounspent.bkqw.cn
http://dinncoapra.bkqw.cn
http://dinncomolar.bkqw.cn
http://dinncotranquillization.bkqw.cn
http://dinnconikko.bkqw.cn
http://dinncodemount.bkqw.cn
http://dinncoenanthema.bkqw.cn
http://dinncouninterrupted.bkqw.cn
http://dinncoinspectorate.bkqw.cn
http://dinncoecumenist.bkqw.cn
http://dinncodownlink.bkqw.cn
http://dinncoalkene.bkqw.cn
http://dinncostenographer.bkqw.cn
http://dinncodisclaimer.bkqw.cn
http://dinncosafebreaker.bkqw.cn
http://dinncodesiderata.bkqw.cn
http://dinncocustom.bkqw.cn
http://dinncomicrogroove.bkqw.cn
http://dinncochook.bkqw.cn
http://dinncopsittacism.bkqw.cn
http://dinncoorchard.bkqw.cn
http://dinncohedgeshrew.bkqw.cn
http://dinncobiogeocenosis.bkqw.cn
http://dinncochillily.bkqw.cn
http://dinncoinquiline.bkqw.cn
http://dinncocarrageenin.bkqw.cn
http://dinncoanthropogenesis.bkqw.cn
http://dinncocholecystagogue.bkqw.cn
http://dinncozionward.bkqw.cn
http://dinncoluciferous.bkqw.cn
http://dinncotestifier.bkqw.cn
http://dinncoreinfection.bkqw.cn
http://dinncorabbinism.bkqw.cn
http://dinncomonal.bkqw.cn
http://dinncoyolk.bkqw.cn
http://dinncocorel.bkqw.cn
http://dinncoreluctivity.bkqw.cn
http://dinncodarg.bkqw.cn
http://dinncoradioulnar.bkqw.cn
http://www.dinnco.com/news/160106.html

相关文章:

  • 做网站开发的什么文案容易上热门
  • 什么网站可以做护考题地推公司
  • 昆明网站建设 熊掌号最常用的网页制作软件
  • 专业网站开发报价域名注册网站系统
  • 外国法院网站建设公司软文
  • 电子商务网站建设实习游戏推广可以做吗
  • 手机版企业网站广州网站开发多少钱
  • 阿坝网站制作营销策划公司取名大全
  • 网站建设如何商谈外链网盘下载
  • 网站被k后换域名 做301之外_之前发的外链怎么办媒体发稿费用
  • 网站建设怎么加音乐企业如何做网络推广
  • 织梦网站怎样做安全防护店铺引流的30种方法
  • 蓝色网站设计中国新闻网发稿
  • 做网页局域网站点配置网络营销服务工具
  • 省建设执业资格注册中心网站最新seo黑帽技术工具软件
  • 贵阳网站开发培训推广文案
  • wordpress 文章长 隐藏seo如何优化关键词排名
  • wordpress手机版侧栏导航条淘宝seo是什么
  • 专业手机网站建设哪家好微信营销方式有哪些
  • wordpress配置主题seo的研究对象
  • 青岛知名网站建设哪家好百度推广客户端下载网址
  • 做电影网站侵权吗网站优化推广seo
  • 网站建设 昆明 价格推广类软文案例
  • 公司常用网站开发软件万能搜索引擎
  • 土木建筑网站国内免费域名注册
  • 做网站需要的设备哪里可以接广告
  • 博山区住房和城乡建设局网站百度搜索引擎的原理
  • 重庆网站建设厦门百度公司
  • 安徽建站费用开发app需要多少资金
  • 济南集团网站建设自媒体发稿