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

德阳 网站建设wordpress设置标题颜色

德阳 网站建设,wordpress设置标题颜色,人工智能绘画,北京百度推广排名优化动态组件的基本使用 动态组件#xff08;Dynamic Components#xff09;是一种在 Vue 中根据条件或用户输入来动态渲染不同组件的技术。 在 Vue 中使用动态组件#xff0c;可以使用 元素#xff0c;并通过 is 特性绑定一个组件的名称或组件对象。通过在父组件中改变 is 特…动态组件的基本使用 动态组件Dynamic Components是一种在 Vue 中根据条件或用户输入来动态渲染不同组件的技术。 在 Vue 中使用动态组件可以使用 元素并通过 is 特性绑定一个组件的名称或组件对象。通过在父组件中改变 is 特性的值可以动态切换渲染的组件。 第一种写法 A.vue templatedivA component/div /templatescript setup langts/scriptstyle scoped/styleB.vue C.vue 同理 APP.vue templatediv styledisplay: flex;!-- class可以写两个一个静态一个动态 --div clickswitchCom(item, index) :class[active index ? active : ] classtabsv-for(item, index) in datadiv{{ item.name }}/div/div/divcomponent :iscomId/component /templatescript setup langts import { ref, reactive } from vue; import AVue from ./components/A.vue import BVue from ./components/B.vue import CVue from ./components/C.vue // 这里不需要将对象中所有数据变为响应式可以使用ref const comId ref(AVue) const active ref(0)const switchCom (item, index) {comId.value item.comactive.value index }const data reactive([{name: A,com: AVue},{name: B,com: BVue},{name: C,com: CVue} ]) /scriptstyle langscss scoped .active {background: blueviolet; }.tabs {border: 1px solid #ccc;padding: 5px 10px;margin: 5px;cursor: pointer;} /style第二种写法 APP.vue templatediv styledisplay: flex;!-- class可以写两个一个静态一个动态 --div clickswitchCom(item, index) :class[active index ? active : ] classtabsv-for(item, index) in datadiv{{ item.name }}/div/div/divcomponent :iscomId/component /templatescript setup langts // markRaw作用标记一个对象使其永远不会再成为响应式对象。 import { ref, reactive, markRaw, shallowRef } from vue;// 这里不需要将对象中所有数据变为响应式可以使用ref const comId shallowRef(AVue) const active ref(0)const switchCom (item, index) {comId.value item.comconsole.log(comId.value);active.value index }const data reactive([{name: A,com:AVue},{name: B,com:BVue},{name: C,com:CVue} ]) /scriptscript langts import AVue from ./components/A.vue import BVue from ./components/B.vue import CVue from ./components/C.vueexport default {components: {AVue,BVue,CVue} } /scriptstyle langscss scoped .active {background: blueviolet; }.tabs {border: 1px solid #ccc;padding: 5px 10px;margin: 5px;cursor: pointer;} /style性能优化 上述第一种写法代码会出现警告 输出 comId 的值出现 comId 的属性被劫持出现性能浪费 解决方法 使用markRaw和shallowRef这两个API App.vue templatediv styledisplay: flex;!-- class可以写两个一个静态一个动态 --div clickswitchCom(item, index) :class[active index ? active : ] classtabsv-for(item, index) in datadiv{{ item.name }}/div/div/divcomponent :iscomId/component /templatescript setup langts // markRaw作用标记一个对象使其永远不会再成为响应式对象。 import { ref, reactive, markRaw, shallowRef } from vue; import AVue from ./components/A.vue import BVue from ./components/B.vue import CVue from ./components/C.vue // 这里不需要将对象中所有数据变为响应式可以使用ref const comId shallowRef(AVue) const active ref(0)const switchCom (item, index) {comId.value item.comconsole.log(comId.value);active.value index }const data reactive([{name: A,com: markRaw(AVue)},{name: B,com: markRaw(BVue)},{name: C,com: markRaw(CVue)} ]) /scriptstyle langscss scoped .active {background: blueviolet; }.tabs {border: 1px solid #ccc;padding: 5px 10px;margin: 5px;cursor: pointer;} /style再次输出 comId 的值解决性能浪费的问题
http://www.w-s-a.com/news/987484/

相关文章:

  • 电商网站建设合同模板临汾推广型网站建设
  • 天猫商务网站建设目的长春网站设计
  • 公司网站建设会议纪要昆山高端网站建设机构
  • 做消费网站流程深圳网站设计价格
  • 做电影网站怎么接广告中国最新军事新闻视频
  • 网站推广设计做哪些设置自动删除的wordpress
  • 东莞东坑网站设计专业网站制作设
  • 网站怎么做现场直播视频成都科技网站建设找
  • 个人网页设计步骤网站没有内容 能做优化吗
  • 专业网站建设公司招聘网站排行榜
  • 网站建设规范方法企业解决方案架构
  • ae做网站导航wordpress门户
  • 重庆市网站备案材料云南做网站
  • 网页设计模板网站免费珠海视窗网
  • 茂名模板建站定制WordPress注册不提示
  • 陕西营销型手机网站建设深圳制作网站服务
  • 受欢迎的锦州网站建设Wordpress 图片左右滑动
  • 湖南优化网站建设线上网站建设需求
  • 建什么类型的网站访问量比较大哪些外包公司比较好
  • php网站地图外贸建站哪家强外贸网站怎么做
  • 宁波五金网站建设中国建筑网官网投诉查询
  • 哪个网站注册域名便宜免费流程图制作网站
  • 潍坊做网站南宁网站seo优化公司
  • 网站建设的基本技术步骤无网站营销
  • 我国旅游网站的建设网站开发 混合式 数据库
  • 淘宝客网站域名家居网站开发项目计划书
  • 网站打不开显示asp苏州注册公司需要多少钱
  • 凡科建站登录官网wordpress主题有什么用
  • 西安双语网站建设怎么做网页动图
  • 宝安自适应网站建设无锡新区企业网站推广