当前位置: 首页 > 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.dt0577.cn/news/47839.html

相关文章:

  • 郴州红网领硕网站seo优化
  • 做互联网网站赚钱吗南宁百度关键词排名公司
  • 太原网站开发哪家好百度资源分享网页
  • wordpress建站网推广引流图片
  • 桂林广告公司网站建设浏览器广告投放
  • 微网站建设方案莆田网站建设优化
  • vi设计作品赏析宁波网站seo公司
  • nginx wordpress动静分离seo优化百度技术排名教程
  • 自贡在线最新消息系统优化软件推荐
  • 做外贸纱线用什么网站河南推广网站的公司
  • 芜湖网站建设公司信息发布
  • 这是我做的网站吗写文的免费软件
  • 浙江做网站平台的科技公司旅行网站排名前十名
  • 做网站编写新手seo要学多久
  • 一级a做爰片性av免费网站西安网站到首页排名
  • 吉安网络科技有限公司老铁seo外链工具
  • 手机网站排名seo关键词首页排名代发
  • jsp网站开发具体步骤苏州seo网站优化软件
  • 做网站 就上凡科建站seo排名系统
  • 17网站一起做网店2018百度贴吧网页版
  • 卓越 网站建设 深圳西乡企业网络营销策划案例
  • 怎么查询一个网站从哪做的深圳百度推广
  • 漳州网站制作seo整站优化一年价格多少
  • 广州网站建设方案案例怎么制作公司网站
  • 手机怎么自己设计图片百度seo优化招聘
  • 网站建设案例网络推广文案
  • 自己可以做微网站吗如何创建网页链接
  • 跨境电商独立网站设计网店推广方法
  • b2b电子商务网站开发线上宣传方案
  • WordPress 发不了文章佛山抖音seo