那个网站可以做视频app制作的,wordpress删除dux主题,全球网站流量排名100,基础微网站开发代理一、Component方法
Component方法用于创建自定义组件#xff0c;小程序页面也可以使用Component方法进行创建#xff0c;从而实现复杂的页面逻辑开发。 使用Component方法构造页面#xff0c;可以实现更加复杂的页面逻辑开发。 二、注意事项 1、要求.json文件中必须包含usi…
一、Component方法
Component方法用于创建自定义组件小程序页面也可以使用Component方法进行创建从而实现复杂的页面逻辑开发。 使用Component方法构造页面可以实现更加复杂的页面逻辑开发。 二、注意事项 1、要求.json文件中必须包含usingComponents字段。 2、里面的配置项要和Component中的配置项保持一致。 3、页面中Page方法有一些钩子函数、时间监听方法这些钩子函数、时间监听方法必须放到methods对象中。 4、组件的属性properties也可以接收页面的参数在onLoad钩子函数中可以通过this.data进行获取。
Component({// 组件的属性properties也可以接收页面的参数在onLoad钩子函数中可以通过this.data进行获取properties:{id:String,title:String},data:{name:tom},methods:{updateDate(){this.setData({name:jerry})},onLoad(options){// 传参通过options接收console.log(页面加载)console.log(options)// 使用properties进行接受使用this.data进行获取console.log(this.data.id)console.log(this.data.title)// 使用properties进行接受使用this.properties进行获取console.log(this.properties)}}})