mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs(DatetimePicker): add tips of min-date (#4838)
This commit is contained in:
parent
80fc7024f8
commit
d5c8647ecf
@ -147,6 +147,15 @@ export default {
|
||||
}
|
||||
```
|
||||
|
||||
## 常见问题
|
||||
|
||||
### 设置 min-date 或 max-date 后出现页面卡死的情况?
|
||||
|
||||
请注意不要在模板中直接使用类似`min-date="new Date()"`的写法,这样会导致每次渲染组件时传入一个新的 Date 对象,而传入新的数据会触发下一次渲染,从而陷入死循环。
|
||||
|
||||
正确的做法是将`min-date`作为一个数据定义在`data`函数中。
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### Props
|
||||
|
Loading…
x
Reference in New Issue
Block a user