中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

做網(wǎng)站需要多少人中國(guó)十大電商公司排名

做網(wǎng)站需要多少人,中國(guó)十大電商公司排名,wordpress在線(xiàn)培訓(xùn),日產(chǎn)b站免mv費(fèi)看入口直播使用場(chǎng)景: 多個(gè)組件通過(guò)component標(biāo)簽掛載在同一個(gè)組件中,通過(guò)觸發(fā)時(shí)間進(jìn)行動(dòng)態(tài)切換。vue3與vue2用法不一樣,這里有坑! 使用方法: 1.通過(guò)vue的defineAsyncComponent實(shí)現(xiàn)掛載組件 2.component中的is屬性 父組件&am…

使用場(chǎng)景:

多個(gè)組件通過(guò)component標(biāo)簽掛載在同一個(gè)組件中,通過(guò)觸發(fā)時(shí)間進(jìn)行動(dòng)態(tài)切換。vue3與vue2用法不一樣,這里有坑!

使用方法:

1.通過(guò)vue的defineAsyncComponent實(shí)現(xiàn)掛載組件

2.component中的is屬性

父組件:

<template><div><div v-for="item in person.data" :key="item" @click="btn(item)">{{ item.name }}</div><h1>下面為動(dòng)態(tài)組件</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>

效果:

這里會(huì)有警告: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收到一個(gè)組件,該組件被設(shè)置為反應(yīng)對(duì)象。這可能會(huì)導(dǎo)致不必要的性能開(kāi)銷(xiāo),應(yīng)該通過(guò)用“markRaw”標(biāo)記組件或使用“shallowRef”而不是“ref”來(lái)避免。)

????????

解決方法:

1.使用shallowRef替換響應(yīng)式

<template><div><div v-for="item in person.data" :key="item" @click="btn(item)">{{ item.name }}</div><h1>下面為動(dòng)態(tài)組件</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://www.risenshineclean.com/news/41314.html

相關(guān)文章:

  • 網(wǎng)站商城定制網(wǎng)站建設(shè)哪個(gè)平臺(tái)可以免費(fèi)發(fā)廣告
  • 簡(jiǎn)潔企業(yè)網(wǎng)站源碼專(zhuān)注于seo顧問(wèn)
  • 揭陽(yáng)cms建站模板數(shù)據(jù)分析師35歲以后怎么辦
  • wordpress調(diào)用js函數(shù)魔方優(yōu)化大師官網(wǎng)下載
  • 網(wǎng)絡(luò)規(guī)劃設(shè)計(jì) 網(wǎng)站建設(shè)seo視頻教程百度網(wǎng)盤(pán)
  • wap網(wǎng)站建設(shè)公司新聞?lì)^條今天最新消息
  • 帝國(guó)網(wǎng)站管理系統(tǒng)入門(mén)教程百度排名點(diǎn)擊軟件
  • 企業(yè)做網(wǎng)站有用嗎簡(jiǎn)述如何對(duì)網(wǎng)站進(jìn)行推廣
  • 做槍版電影網(wǎng)站賺錢(qián)免費(fèi)二級(jí)域名平臺(tái)
  • 臺(tái)前做網(wǎng)站的公司廣告文案
  • 推廣普通話(huà)宣傳周活動(dòng)方案長(zhǎng)沙seo免費(fèi)診斷
  • 制作一個(gè)網(wǎng)站需要什么推廣合作
  • 佛山網(wǎng)站建設(shè)公司88百度的鏈接
  • dede的網(wǎng)站地圖要怎么做網(wǎng)站推廣平臺(tái)
  • 同一個(gè)服務(wù)器可以做多個(gè)網(wǎng)站百度收錄規(guī)則
  • 論壇網(wǎng)站html模板廣州aso優(yōu)化公司 有限公司
  • 網(wǎng)站建設(shè)請(qǐng)示文件茶葉網(wǎng)絡(luò)營(yíng)銷(xiāo)策劃方案
  • 地下城釣魚(yú)網(wǎng)站怎么做營(yíng)銷(xiāo)網(wǎng)站建設(shè)軟件下載
  • php網(wǎng)站開(kāi)發(fā)常用的插件seo排名賺app最新版本
  • 做齊魯油官方網(wǎng)站軟件推廣平臺(tái)有哪些
  • 視頻音樂(lè)網(wǎng)站怎樣建設(shè)濰坊seo培訓(xùn)
  • 徐州建站服務(wù)av手機(jī)在線(xiàn)精品
  • 上海專(zhuān)業(yè)網(wǎng)站建設(shè) 公司中國(guó)站免費(fèi)推廣入口
  • 教育部教育考試院網(wǎng)站網(wǎng)頁(yè)的優(yōu)化方法
  • 建設(shè)部繼續(xù)教育網(wǎng)站網(wǎng)站制作方案
  • 攜程旅行網(wǎng)站內(nèi)容的建設(shè)軟文發(fā)布軟件
  • 抖音app下載seo外包方法
  • 如何請(qǐng)人創(chuàng)建一個(gè)網(wǎng)站信息流廣告素材網(wǎng)站
  • 做淘寶需要的網(wǎng)站數(shù)字化營(yíng)銷(xiāo)
  • 直播app開(kāi)發(fā)一個(gè)需要多少錢(qián)整站優(yōu)化報(bào)價(jià)