通过schema2code字段为date生成日期组件
3***@qq.com
- 发布:2024-08-19 08:38
- 更新:2024-08-19 10:22
- 阅读:124
3***@qq.com (作者)
数据库字段:
{
"bsonType": "object",
"required": ["loading_time"],
"permission": {
"read": true,
"create": true,
"update": true,
"delete": true
},
"properties": {
"_id": {
"description": "ID,系统自动生成"
},
"loading_time": {
"bsonType": "timestamp",
"title": "装车时间",
"description": "装车时间",
"permission": {
"read": "'READ_APP_CARGO' in auth.permission",
"write": "'CREATE_APP_CARGO' in auth.permission || 'UPDATE_APP_CARGO' in auth.permission"
}
}
}
}
生成组件:
<uni-forms-item name="loading_time" label="装车时间" required>
<uni-datetime-picker type="date" return-type="timestamp" v-model="formData.loading_time"></uni-datetime-picker>
</uni-forms-item>
2024-08-19 11:17
3***@qq.com (作者)
原生成组件为: return-type="date" 直接不能用
2024-08-19 11:18
DCloud_UNI_yuhe
回复 3***@qq.com: 尝试一下设为时间戳内个类型应该可以的
2024-08-19 11:19
3***@qq.com (作者)
回复 DCloud_UNI_yuhe: 试了 还是英文的
2024-08-20 10:36