热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_53051713
油麦菜你好
4 年前
trueweixin_53051713

小程序P65 05.自定义组件的properties
1、自定义properties属性
<!--pages/home/home.wxml-->
<view></view>
<my-test1 max="9"></my-test1>

<!--components/test/test.wxml-->
<button bindtap="showInfo">showInfo</button>
<view>max属性的值是:{{max}}</view>

// components/test/test.js
properties: {
//第一种:简化的方式
//max:Number
//第二种:完整的定义方式
max:{
type:Number,
value:10 } },
methods: {
//点击事件处理函数
addCount() {
if(this.data.count >= this.properties.max) return
this.setData({
count:this.data.count+1,
max:this.properties.max+1
})
this._showCount()
},
_showCount(){
wx.showToast({
title: 'count是'+this.data.count,
icon:'none'
})
},
showInfo(){
console.log(this.data)
console.log(this.properties)
console.log(this.data == this.properties)
}
}


CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条:
在某些较低级别的视觉识别任务中,包括图像分类、分割和目标检测,机器已经取得了接近人类的表现,甚至超过人类。然而,对于其他需要更详细理解视觉内容的更高层次的视觉任务,如视觉问答(VQA)和视觉描述(VC),机器仍然落后于人类。这在一定程度上是因为,与人类不同,机器缺乏对内容建立全面的、结构化的理解的能力,在此基础上进行推理。
立即登录