naive-ui/demo/documentation/components/date-picker/zhCN/format.demo.md

26 lines
415 B
Markdown
Raw Normal View History

2020-02-19 16:24:39 +08:00
# 格式化
```html
<n-date-picker
2020-10-05 03:50:59 +08:00
v-model:value="timestamp"
2020-02-19 16:24:39 +08:00
type="datetime"
clearable
:format="format"
/>
2020-10-05 03:50:59 +08:00
<n-date-picker v-model:value="timestamp2" type="datetime" :format="format" clearable />
2020-02-19 16:24:39 +08:00
```
```js
export default {
data () {
return {
timestamp: null,
2020-05-31 14:21:09 +08:00
timestamp2: 1183135260000,
2020-02-26 17:21:03 +08:00
format: 'yyyy/MM/dd - HH:mm'
2020-02-19 16:24:39 +08:00
}
}
}
```
```css
.n-date-picker {
margin: 0 12px 8px 0;
}
```