deguodaigou/components/shopping/shoppingitem/shoppingitem.js
2019-12-17 09:54:17 +08:00

41 lines
703 B
JavaScript

// components/shopping/shoppingitem/shoppingitem.js
Component({
/**
* 组件的属性列表
*/
properties: {
shospname: String,
shopdesc: String,
price: Number,
pic: String
},
/**
* 组件的初始数据
*/
data: {
num: 5
},
/**
* 组件的方法列表
*/
methods: {
rm() {
if (this.data.num == 0) {
return
} else {
this.setData({
num: this.data.num - 1
})
}
},
add() {
this.setData({
num: this.data.num + 1
})
}
}
})