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

查公司的口碑和评价的网站西乡做网站公司

查公司的口碑和评价的网站,西乡做网站公司,网上电商平台,亿缘网站建设使用场景#xff1a; 多个组件通过component标签挂载在同一个组件中#xff0c;通过触发时间进行动态切换。vue3与vue2用法不一样#xff0c;这里有坑#xff01; 使用方法#xff1a; 1.通过vue的defineAsyncComponent实现挂载组件 2.component中的is属性 父组件 多个组件通过component标签挂载在同一个组件中通过触发时间进行动态切换。vue3与vue2用法不一样这里有坑 使用方法 1.通过vue的defineAsyncComponent实现挂载组件 2.component中的is属性 父组件 templatedivdiv v-foritem in person.data :keyitem clickbtn(item){{ item.name }}/divh1下面为动态组件/h1component :isperson.componen /component/div /templatescript 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 子组件 templatediv组件一/divel-input v-modelperson.input/el-input /templatescript setup import { ref, reactive, onMounted, computed, watch } from vue;const person reactive({ input: }); onMounted(() {console.log(组件一); }); /script style scoped langless /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替换响应式 templatedivdiv v-foritem in person.data :keyitem clickbtn(item){{ item.name }}/divh1下面为动态组件/h1keep-alivecomponent :iscomponen /component/keep-alive/div /templatescript 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 langless /style
http://www.pierceye.com/news/120685/

相关文章:

  • 户外旅游网站模板网站开发需要看相关书籍
  • 建设高端网站的公司企业营销网站建设公司
  • 重庆建设工程信息网站重庆企业网站建设报价
  • 大兴模版网站开发公司哪家好unn建站
  • 工信部网站域名备案查询北京科技网站建设公司
  • 昆明做网站那家好自己动手做网站
  • 女生做seo网站推广北京海岸设计公司网站
  • 单位建设网站硬件拍摄制作宣传片企业
  • 网站做推广应该如何来做呢哪里推广柳州360优化
  • 淘宝网站的建设目的济宁网站建设 中企动力临沂
  • 小米商城网站建设浏览器广告投放
  • 网站制作论文致谢wordpress首页导航栏
  • 网站右下角调用优酷视频广告代码酒泉地网站推广
  • 武清做网站的wordpress选择php
  • 最潮流的网站开发脚本语言icp网站备案
  • 盘锦网站建设平台wordpress英文模板
  • f2c网站建设公司单位名称大全
  • 泉州最专业手机网站建设哪家好重庆网站备案注销
  • 网站素材类型传统网站有没有建设必要性
  • 我的网站模板下载大连金普新区规划建设局网站
  • 营销案例网站织梦系统网站
  • 网站推广优化业务网站开发项目的里程碑
  • 小程序建站哪家好深圳建设银行官方网站
  • 免费红色ppt模板网站装修网站合作
  • iis7 添加网站古风头像在线制作免费
  • 电商网站构成网站尺寸自适应
  • 南昌网站建设咨询最简 wordpress主题
  • 污染网站代码建立官方网站
  • 整站网站模板乌海网站建设
  • 具体c2c网站建设实例商城网站建设价格最优