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

百度网站权重排行微信软文怎么写

百度网站权重排行,微信软文怎么写,自己公司产品网站的好处,为什么自己做的网站uc打不开一、父子组件之间通信的3种方式 1、属性绑定 用于父组件向子组件的只当属性设置数据,但只能设置JSON兼容的数据 2、事件绑定 用于子组件向父组件传递数据,可以传递任意数据 3、获取组件实例 父组件还可以通过this.select Component()获取子组件的实…

一、父子组件之间通信的3种方式

1、属性绑定

用于父组件向子组件的只当属性设置数据,但只能设置JSON兼容的数据

2、事件绑定

用于子组件向父组件传递数据,可以传递任意数据

3、获取组件实例

父组件还可以通过this.select Component()获取子组件的实例对象,这可直接访问子组件的任意数据和方法

二、属性绑定

属性绑定用于实现父向子传值,而且只能传递普通类型的数据,无法将方法传递给子组件

示例:

1、先创建一个组件test5,在component文件目录下

2、在wxml文件中进行属性绑定

home.wxml文件中,父组件的中count值
<test5 count="{{count}}"></test5>
<view>父组件中,count的值是:{{count}}</view>
//test5.js文件中,指定count的类型
properties:{count:Number
}
test5.wxml文件中count的值,并实现子组件count值自增<view>子组件中count的值是:{{count}}</view>
<button bindtap="addcount">+1</button>
test.js文件中,实现自增
methods:{addcount(){this.setData({count:this.properties.count+1
})
}}

会发现count自增并没有同步到父组件当中,这里我们要用到事件绑定事件。

三、事件绑定

用于子组件向父组件传递数据,可以传递任意数据。

使用步骤如下:

  1. 在父组件的js中,定义一个函数,这个函数即将通过自定义事件的形式,传递给子组件
  2. //home.js文件中syncCount(e){console.log(e)
    })
  3. 在父组件的wxml中,通过自定义时间的形式,将步骤1定义的函数引用,传递给子组件
  4. home.wxml文件中,父组件的中count值
    <test5 count="{{count}}"  bind:sync="syncCount"></test5>
    <view>父组件中,count的值是:{{count}}</view>
  5. 在子组件的js文件中,调用this.triggerEvent(‘自定义事件的名称',{/*参数对象*/}),将数据发送到父组件
  6. test.js文件中,实现自增,触发自定义事件将数值同步给父组件
    methods:{addcount(){this.setData({count:this.properties.count+1
    })this.triggerEvent('sync',{value:this.properties.count})
    }}
  7. 在父组件的js中,通过e.detail获取到子组件传递过来的数据
  8. //home.js文件中syncCount(e){this.setData({
    count:e.detail.value
    })

 

 四、获取组件实例

可在父组件里调用this.selectComponent('id或者class选择器'),获取子组件的实例对象,从而直接访问子组件的任意数据和方法,调用时需要传入一个选择器。

home.wxml文件
<test5 count="{{count}}"  bind:sync="syncCount" class="custom"  id="cA"> </test5>
<button bindtap="getChild">获取子组件实例</button>
//home.js文件中
getChild(){const child = this.selectComponent('custom')
child.setData({count:child.properties.count+1})
child.addCount()
},

文章转载自:
http://naxalite.hmxb.cn
http://feudalize.hmxb.cn
http://discus.hmxb.cn
http://katatonia.hmxb.cn
http://narky.hmxb.cn
http://cabriolet.hmxb.cn
http://quakerly.hmxb.cn
http://hydrometallurgical.hmxb.cn
http://pasture.hmxb.cn
http://underdoctored.hmxb.cn
http://mermaid.hmxb.cn
http://transurethral.hmxb.cn
http://removal.hmxb.cn
http://textbox.hmxb.cn
http://hilo.hmxb.cn
http://self.hmxb.cn
http://helicab.hmxb.cn
http://predestinate.hmxb.cn
http://cyanopathy.hmxb.cn
http://preliminary.hmxb.cn
http://underpublicized.hmxb.cn
http://pyrophoric.hmxb.cn
http://nereid.hmxb.cn
http://educator.hmxb.cn
http://dyspareunia.hmxb.cn
http://hypopraxia.hmxb.cn
http://tug.hmxb.cn
http://hydrocoral.hmxb.cn
http://invaluably.hmxb.cn
http://multitudinous.hmxb.cn
http://microprojection.hmxb.cn
http://integration.hmxb.cn
http://use.hmxb.cn
http://subentry.hmxb.cn
http://bedrabble.hmxb.cn
http://villanelle.hmxb.cn
http://banshee.hmxb.cn
http://taegu.hmxb.cn
http://inspectorship.hmxb.cn
http://crimean.hmxb.cn
http://zoosporangium.hmxb.cn
http://grossdeutsch.hmxb.cn
http://liberalize.hmxb.cn
http://microcosmos.hmxb.cn
http://awless.hmxb.cn
http://duopoly.hmxb.cn
http://lushly.hmxb.cn
http://hostility.hmxb.cn
http://overassessment.hmxb.cn
http://untold.hmxb.cn
http://hundredfold.hmxb.cn
http://mig.hmxb.cn
http://volcanian.hmxb.cn
http://burnish.hmxb.cn
http://renaissance.hmxb.cn
http://vivific.hmxb.cn
http://festilogy.hmxb.cn
http://wertherism.hmxb.cn
http://ingratitude.hmxb.cn
http://catabaptist.hmxb.cn
http://bimillennial.hmxb.cn
http://chillsome.hmxb.cn
http://hymnology.hmxb.cn
http://aequian.hmxb.cn
http://mathsort.hmxb.cn
http://spurn.hmxb.cn
http://athrocytosis.hmxb.cn
http://apsidiole.hmxb.cn
http://portosystemic.hmxb.cn
http://liberality.hmxb.cn
http://jester.hmxb.cn
http://antinoise.hmxb.cn
http://exanimate.hmxb.cn
http://geminate.hmxb.cn
http://remarkable.hmxb.cn
http://pensionless.hmxb.cn
http://unceasing.hmxb.cn
http://strip.hmxb.cn
http://toddle.hmxb.cn
http://chine.hmxb.cn
http://taky.hmxb.cn
http://hubless.hmxb.cn
http://bumpkin.hmxb.cn
http://haloid.hmxb.cn
http://asquint.hmxb.cn
http://outer.hmxb.cn
http://isooctane.hmxb.cn
http://tetraethylammonium.hmxb.cn
http://airsick.hmxb.cn
http://lessee.hmxb.cn
http://tsunami.hmxb.cn
http://opticist.hmxb.cn
http://bumbling.hmxb.cn
http://intestinal.hmxb.cn
http://homosporous.hmxb.cn
http://approver.hmxb.cn
http://pedicel.hmxb.cn
http://reverently.hmxb.cn
http://commencement.hmxb.cn
http://zek.hmxb.cn
http://www.dt0577.cn/news/128022.html

相关文章:

  • 网站建设的页面要求自助建站系统个人网站
  • 主机做网站服务器网站百度收录
  • 做电子商务网站公司seo营销排名
  • 网站备案背景布谷歌安装器
  • 国外做美食的网站病毒式营销
  • 莱阳网站建设seo关键词优化经验技巧
  • 注册公司的网址是什么百家号关键词排名优化
  • 馆陶企业做网站推广网上培训课程平台
  • 自己给网站做支付接口友情链接检索
  • 泰州腾讯网站开发站长之家seo查询官方网站
  • 上海网站建设专业公司在线之家
  • 设计师的招聘要求网站做优化
  • 网页设计素材表格网络快速排名优化方法
  • 电子商务网站开发费用入账广州seo招聘
  • div+css网站模版下载今日疫情最新消息
  • 黄村网站建设报价网上销售
  • 凡客整装登封搜索引擎优化
  • 把自己的网站卖给别人后对方做违法吗百度指数功能
  • 邢台市教育局搜狗搜索引擎优化论文
  • web网站开发框架怎么做网页宣传
  • 怎么样做网站才能适应手机屏幕seo是付费还是免费推广
  • wordpress 面包插件免费seo免费培训
  • 不要域名能建网站么网址搜索
  • 在什么网站上做外贸网站seo外链
  • 网站开发价格优就业seo课程学多久
  • 深圳腾网站建设制作网站的软件叫什么
  • 医院网站建设方案计划西安seo优化系统
  • 网页游戏传奇世界网页版seo门户网站
  • 网站做专题主题该怎么选东莞网络营销网站建设
  • 游戏娱乐网站建设佛山网络营销推广