naive-ui/demo/documentation/components/datePicker/zhCN/format.md

32 lines
546 B
Markdown
Raw Normal View History

2020-02-19 16:24:39 +08:00
# 格式化
```html
<n-date-picker
v-model="timestamp"
type="datetime"
:disabledTime= "disabledTime"
clearable
:format="format"
/>
<n-date-picker v-model="timestamp2" type="datetime" :format="format" clearable />
```
```js
export default {
data () {
return {
timestamp: null,
timestamp2: 1000000,
2020-02-26 17:21:03 +08:00
format: 'yyyy/MM/dd - HH:mm'
2020-02-19 16:24:39 +08:00
}
},
methods: {
disabledTime (current) {
return current > 1573552182000 && current < 1573811382000
}
}
}
```
```css
.n-date-picker {
margin: 0 12px 8px 0;
}
```