<template>
<view class="page container">
<uni-card is-full>
<text class="uni-h6">可以同时选择日期和时间的选择器</text>
</uni-card>
<uni-section :title="'日期时间用法:' + datetimesingle" type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker type="datetime" v-model="datetimesingle" @change="changeLog" />
</view>
</view>
</template>
<script>
export default {
data() {
return {
datetimesingle: '',
}
},
watch: {
datetimesingle(newval) {
console.log('单选:', this.datetimesingle);
},
},
mounted() {
setTimeout(() => {
this.datetimesingle = Date.now() - 2*24*3600*1000
},3000)
},
methods:{
changeLog(e) {
console.log('change事件:', e);
},
}
}
</script>
- 发布:2023-02-22 13:27
- 更新:2023-02-23 09:47
- 阅读:662
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 10
HBuilderX类型: 正式
HBuilderX版本号: 3.6.18
第三方开发者工具版本号: 1.06.2301160
基础库版本号: 2.28.1
项目创建方式: HBuilderX
操作步骤:
预期结果:
预期就是正常结果
预期就是正常结果
实际结果:
VM9 asdebug.js:10 TypeError: Cannot read property 'is' of undefined
at WAServiceMainContext.js?t=wechat&s=1677043130067&v=2.28.1:1
at WASubContext.js?t=wechat&s=1677043130067&v=2.28.1:1
at fe (WASubContext.js?t=wechat&s=1677043130067&v=2.28.1:1)
at pe (WASubContext.js?t=wechat&s=1677043130067&v=2.28.1:1)
at WASubContext.js?t=wechat&s=1677043130067&v=2.28.1:1
at WAServiceMainContext.js?t=wechat&s=1677043130067&v=2.28.1:1
at o.emit (WAServiceMainContext.js?t=wechat&s=1677043130067&v=2.28.1:1)
at D.dispatch (WAServiceMainContext.js?t=wechat&s=1677043130067&v=2.28.1:1)
at D.cb (WAServiceMainContext.js?t=wechat&s=1677043130067&v=2.28.1:1)
at a (VM9 asdebug.js:10)(env: Windows,mp,1.06.2301160; lib: 2.28.1)
VM9 asdebug.js:10 TypeError: Cannot read property 'is' of undefined
at WAServiceMainContext.js?t=wechat&s=1677043130067&v=2.28.1:1
at WASubContext.js?t=wechat&s=1677043130067&v=2.28.1:1
at fe (WASubContext.js?t=wechat&s=1677043130067&v=2.28.1:1)
at pe (WASubContext.js?t=wechat&s=1677043130067&v=2.28.1:1)
at WASubContext.js?t=wechat&s=1677043130067&v=2.28.1:1
at WAServiceMainContext.js?t=wechat&s=1677043130067&v=2.28.1:1
at o.emit (WAServiceMainContext.js?t=wechat&s=1677043130067&v=2.28.1:1)
at D.dispatch (WAServiceMainContext.js?t=wechat&s=1677043130067&v=2.28.1:1)
at D.cb (WAServiceMainContext.js?t=wechat&s=1677043130067&v=2.28.1:1)
at a (VM9 asdebug.js:10)(env: Windows,mp,1.06.2301160; lib: 2.28.1)
bug描述:
引入 uni-datetime-picker 的时候,微信开发者工具会报错。
引入方式是完全按照uniapp 文档的示例方式所写:
<template>
<view class="page container">
<uni-card is-full>
<text class="uni-h6">可以同时选择日期和时间的选择器</text>
</uni-card>
<uni-section :title="'日期时间用法:' + datetimesingle" type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker type="datetime" v-model="datetimesingle" @change="changeLog" />
</view>
</view>
</template>
<script>
export default {
data() {
return {
datetimesingle: '',
}
},
watch: {
datetimesingle(newval) {
console.log('单选:', this.datetimesingle);
},
},
mounted() {
setTimeout(() => {
this.datetimesingle = Date.now() - 2*24*3600*1000
},3000)
},
methods:{
changeLog(e) {
console.log('change事件:', e);
},
}
}
</script>
报错内容:
crstudio (作者)
我没有下载完整的测试示例项目,只是用了测试示例项目中的同样代码。
2023-02-23 09:42