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

网站首页标题创建网站的软件

网站首页标题,创建网站的软件,深圳一日游必去的地方,网站建设南阳1.component介绍 说明: Type: string | ComponentDefinition | ComponentConstructor Explanation: String: 如果你传递一个字符串给 is,它会被视为组件的名称,用于动态地渲染不同类型的组件。这是一个在运行时动态切换组件类型的常见用例。…

1.component介绍

说明:

  • Type: string | ComponentDefinition | ComponentConstructor

  • Explanation:

    • String: 如果你传递一个字符串给 is,它会被视为组件的名称,用于动态地渲染不同类型的组件。这是一个在运行时动态切换组件类型的常见用例。
    • ComponentDefinition: 你也可以传递组件定义对象,这是一个包含组件选项的对象。
    • ComponentConstructor: 可以传递组件的构造函数。

2.is写法

2.1 is

说明:加载单个组件直接可以不加:

<component is="DynamicMorning"></component>

组件 

<script>
export default {name: "morning"
}
</script><template>
<div>我是早上组件</div>
</template><style scoped></style>

2.2 :is 

说明:动态加载组件写法

    <template v-for="item in DynamicComponent"><component :is="item.type"></component></template>

2.3源码

<script>
import Dynamic from "@/components/Dynamic/index.vue";
import DynamicMorning  from "@/views/Dynamic/morning.vue";
import DynamicAfternoon from "@/views/Dynamic/afternoon.vue";
import DynamicEvening from "@/views/Dynamic/evening.vue";
export default {name: "index",components: {Dynamic,DynamicMorning,DynamicAfternoon,DynamicEvening},data() {return {// 组件数组componentArr: [{id: 1,type: 'Morning'}, {id: 2,type: 'Afternoon'}, {id: 3,type: 'Evening'}]}},computed:{// map遍历同时生成组件名字(类型是个数组)DynamicComponent(){return  this.componentArr.map(item=>{return {...item,type:'Dynamic'+item.type}})}}
}
</script><template><div><h1>我是动态组件父组件</h1><template v-for="item in DynamicComponent"><component :is="item.type"></component></template></div>
</template><style scoped></style>

 

3.源码

<script>
import Dynamic from "@/components/Dynamic/index.vue";
import DynamicMorning from "@/views/Dynamic/morning.vue";
import DynamicAfternoon from "@/views/Dynamic/afternoon.vue";
import DynamicEvening from "@/views/Dynamic/evening.vue";export default {name: "index",components: {Dynamic,DynamicMorning,DynamicAfternoon,DynamicEvening},data() {return {// 组件数组componentArr: [{id: 1,type: 'Morning'}, {id: 2,type: 'Afternoon'}, {id: 3,type: 'Evening'}]}},computed: {// map遍历同时生成组件名字(类型是个数组)DynamicComponent() {return this.componentArr.map(item => {return {...item,type: 'Dynamic' + item.type}})}}
}
</script><template><div><h1>我是动态组件父组件</h1><template v-for="item in DynamicComponent"><component :is="item.type"></component></template><!--    <component is="DynamicMorning"></component>--></div>
</template><style scoped></style>

http://www.hrbkazy.com/news/50128.html

相关文章:

  • 福建seo优化西安seo站内优化
  • 付网站开发费计入什么科目十大网站排行榜
  • 最佳网站西地那非片
  • 家乡政府网站建设评价怎么写公司营销网站建设
  • 温州企业网站开发aso应用优化
  • 免费小程序制作软件搜索引擎优化是指什么意思
  • 拖拽建设网站源码seo咨询师招聘
  • 地方同城网站开发2023年6月份疫情严重吗
  • 苏州园区网站制作公司短视频排名seo
  • 怎么做淘宝网站媒体代发网站
  • 网站开发实用技术第2版西安网络推广seo0515
  • 上海个人做网站南宁网络推广有限公司
  • 卖汽车的网站怎么做开鲁网站seo不用下载
  • 做网站优化的话术弹窗广告最多的网站
  • 博明网站建设近几天发生的新闻大事
  • 任县网站建设设计自己怎么做引流推广
  • 网站制作 电子商城云推广
  • wordpress depthseo技术优化整站
  • 做英语趣味教具的网站个人怎么注册自己的网站
  • 承德网站建设流程网络安全培训最强的机构
  • 网站开发在线测试平台百度企业官网认证
  • 为企业建网站过时了百度销售岗位怎么样
  • 做网站一个人能做吗推销产品的软文500字
  • 做美食网站有哪些新网域名注册查询
  • 网站建设服务费税率多少钱网络营销常用的方法有哪些
  • 广东建设网三库一平台seo关键词排名优化价格
  • 高端网站建设加盟网站页面
  • 基于html5的网站开发软文写手接单平台
  • 拒绝做网站的理由方象科技的服务范围
  • 柳州哪家网站建设专业产品推广渠道