naive-ui/demo/documentation/components/datePicker/zhCN/date.md
2020-02-10 22:27:13 +08:00

544 B

日期

<n-date-picker
  v-model="timestamp"
  type="date"
  :disabledTime="disabledTime"
  clearable
/>
<n-date-picker v-model="timestamp2" type="date" clearable />
<pre>{{ JSON.stringify(timestamp) }}, {{ JSON.stringify(timestamp2) }}</pre>
export default {
  data () {
    return {
      timestamp: null,
      timestamp2: 1000000
    }
  },
  methods: {
    disabledTime (current) {
      return (current >= 1574092800000) && (current < 1574438400000)
    }
  }
}
.n-date-picker {
  margin: 0 12px 8px 0;
}