当前位置: 首页 > 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.hengruixuexiao.com/news/14212.html

相关文章:

  • 沙湾移动网站建设百度收录提交网站后多久收录
  • 无锡市住房和城乡建设部网站全网营销代理加盟
  • 什么网站框架关于网络推广的方法
  • 网站建设发展历程软文发稿平台有哪些
  • 网站的维护费用网站开发工程师
  • 最好的设计师网站如何进行推广
  • 镇江地区做网站的公司简述影响关键词优化的因素
  • 注册一个软件需要多少钱自己做seo网站推广
  • 网站301在哪里做推广费用一般多少
  • wordpress主题转hexoseo顾问咨询
  • 做图片的软件免费网站关键词优化软件效果
  • 游戏网站开发视频bing搜索引擎
  • 用web做购物网站怎么做搜索爱站网关键词密度查询
  • 良乡网站建设公司如何做营销策划方案
  • wordpress微博样式评论广州seo技术外包公司
  • 做设计什么兼职网站建设女生seo专员很难吗为什么
  • 电子商务的网站设计网文网站排名
  • 没有网站怎么做推广东莞seo计费管理
  • 网站更新了域名如何找到做百度推广员赚钱吗
  • 苗木企业网站建设源代码百度关键词推广价格
  • h5效果展示网站网站推广常用的方法
  • 云速成美站福州seo服务
  • 网站开发什么技术在线搜索资源
  • 电子元器件商城网站建设百度竞价点击神器
  • 制作网页和做网站是一个意思吗百度seo优化及推广
  • 怎样自己建设一个网站能打开任何网站浏览器
  • 网站设计的内容有哪些seo是谁
  • 1688网苏州优化排名seo
  • 抽奖网站开发太原网络推广公司哪家好
  • 论坛怎样发帖推广网站优化建设