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

48 lines
951 B
Markdown
Raw Normal View History

2020-02-04 19:05:59 +08:00
# 禁用
2020-01-11 00:56:39 +08:00
```html
<n-date-picker
v-model="datetime"
type="datetime"
:disabled="disabled"
@change="onDateTimeChange"
/>
<n-date-picker
v-model="datetime"
type="date"
:disabled="disabled"
@change="onDateChange"
/>
<n-date-picker
v-model="datetimerange"
:disabled="disabled"
type="datetimerange"
/>
<n-date-picker v-model="daterange" :disabled="disabled" type="daterange" />
<n-switch v-model="disabled" />
```
```js
export default {
data() {
return {
datetime: 891360258000,
date: null,
datetimerange: [324910284, 910391323],
daterange: [324910284, 910391323],
disabled: true
};
},
methods: {
onDateTimeChange(timestamp, dateTimeString) {
this.$NMessage.success(`${timestamp}, ${dateTimeString}`);
},
onDateChange(timestamp, dateString) {
this.$NMessage.success(`${timestamp}, ${dateString}`);
}
}
};
```
```css
.n-date-picker {
margin: 0 12px 8px 0;
}
```