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

怎样做免费网站网络团队建设

怎样做免费网站,网络团队建设,制作微信公众号,网站建设包含目录 子组件向父组件传值子组件1子组件2 父组件最后 子组件向父组件传值 子组件1 <template><view class"content"><view v-for"(item,index) in list" :key"index">{{item}}</view></view> </template>&…

目录

    • 子组件向父组件传值
      • 子组件1
      • 子组件2
    • 父组件
    • 最后

子组件向父组件传值

子组件1

<template><view class="content"><view v-for="(item,index) in list" :key="index">{{item}}</view></view>
</template><script>export default {data() {return {list: []}},components: {},onLoad() {},created() {var data = require('../../static/res.json')this.list = data.fruitDatathis.$emit("getChild1",this.list);},methods: {}}
</script><style>.content {display: flex;flex-direction: column;align-items: center;justify-content: center;}.logo {height: 200upx;width: 200upx;margin-top: 200upx;margin-left: auto;margin-right: auto;margin-bottom: 50upx;}.text-area {display: flex;justify-content: center;}.title {font-size: 36upx;color: #8f8f94;}
</style>

子组件2

<template><view class="content"><view v-for="(item,index) in list" :key="index">{{item}}</view></view>
</template><script>export default {data() {return {list: []}},components: {},onLoad() {},created() {var data = require('../../static/res.json')this.list = data.filmDatathis.$emit("getChild2",this.list);},methods: {}}
</script><style>.content {display: flex;flex-direction: column;align-items: center;justify-content: center;}.logo {height: 200upx;width: 200upx;margin-top: 200upx;margin-left: auto;margin-right: auto;margin-bottom: 50upx;}.text-area {display: flex;justify-content: center;}.title {font-size: 36upx;color: #8f8f94;}
</style>

父组件

<template><view class="content"><view class="btn-container"><button @click="getData(index)" v-for="(item,index) in list" :key="index">{{item}}</button></view><child1 @getChild1 = "getChild1" v-if="current==0"></child1><child2 @getChild2 = "getChild2" v-if="current==1"></child2></view>
</template><script>import child1 from './child1'import child2 from './child2'export default {data() {return {list:['水果','电影'],current:0}},onLoad() {},components: {child1,child2},methods: {getData(index){this.current = index},getChild1(e){console.log(e)},getChild2(e){console.log(e)}}}
</script><style>.content {display: flex;flex-direction: column;align-items: center;justify-content: center;}.btn-container{display: flex;justify-content: space-between;align-items: center;}
</style>

最后

感觉文章好的话记得点个心心和关注和收藏,有错的地方麻烦指正一下,如果需要转载,请标明出处,多谢!!!

http://www.yayakq.cn/news/269458/

相关文章:

  • 加强网站功能建设怎样推广平台
  • 网站做百度推广有没有效果交易网站开发合同范本
  • 怎么看一个网站是html5企业电商网站开发
  • 安徽省建设厅官方网站网银汇款企业做网站用途写什么
  • 电脑做服务器上传网站wordpress 多域名多站点
  • 设计网站首页多少钱域名展示网站源码
  • 网站的类别北京app开发公司排名
  • 江苏省工程建设协会网站上海网站建设 美橙
  • 新网站建设方案ppt关键词如何排名在首页
  • 动漫网站怎么做wordpress 分类层级
  • 网站制作岗位职责国外网站怎么做
  • 外贸网站改版公司哪家好全景网互动平台
  • 网站排队队列怎么做wordpress 首页调用页面标题
  • 上海千途建站深圳推广公司网站建设书模板
  • 网站建设需要怎样的经营范围做电影平台网站怎么赚钱吗
  • 深圳网站备案查询天津网络营销
  • 手机网站建设在哪儿洛阳市宜阳建设局网站
  • 网站源码哪个好外链吧怎么使用
  • 网站建设销售好做嘛hexo框架做网站
  • 无锡富通电力建设有限公司网站电商网站设计是干什么的
  • 网站信息内容建设自查网站创建域名
  • 网站正在建设中敬请科技与应用
  • 烟台哪里有做网站装修工人找活平台
  • 做网站需不需要服务器客户做网站需要提供什么
  • 泉州模板建站公司做pc端网站报价
  • php网站建设的基本流程图机关网站建设需求文档
  • 外贸网站建设费用一般要多少做网站的属于什么专业
  • 引用网站的内容如何做注释工厂网络设计方案
  • 深圳鲜花团购网站建设企业咨询流程
  • 上海松江区做网站的公司wordpress文章尾部