1
onLoad(query) {
// 页面加载
dd.setNavigationBar({
title: "设置title"
})
},
onReady() {
// 页面加载完成
console.log(this, app, dd)
console.log(new Date().format('yyyy-MM-dd'))
this.testGet()
},
2、赋值
data: {
hourPicker: 0,
}
SetRemindTime(e) {
this.setData({
hourPicker: e.detail.value,
});
}
3、跳转
dd.navigateTo({
url: `/pages/preview/preview?name=${name}`
})
4、输入框输入
<textarea onBlur="bindTextAreaBlur" maxlength="100" auto-height placeholder="请输入" />
data: {
describe: "",
}
bindTextAreaBlur: function(e) {
console.log(e.detail.value)
this.setData({
describe: e.detail.value
})
},
5、toast提示
dd.showToast({
type: 'success',
content: '这是个toast',
duration: 3000,
});
6、picker-view使用
QQ图片20200821111056.png
<view class="popup-background" a:if="{{showRemindPopup}}">
<view class="punch-popup">
<picker-view value="{{hourPicker}}" onChange="SetRemindTime">
<picker-view-column>
<view>2019</view>
<view>2020</view>
</picker-view-column>
<picker-view-column>
<view>春</view>
<view>夏</view>
</picker-view-column>
</picker-view>
</view>
</view>













网友评论