tiny-vue_version0/examples/sites/demos/pc/app/date-picker/clear-composition-api.vue

37 lines
880 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div>
<p>默认显示清除按钮</p>
<br />
<div class="demo-date-picker-wrap">
<tiny-date-picker v-model="value"></tiny-date-picker>
</div>
<br />
<p>隐藏清除按钮:</p>
<br />
<div class="demo-date-picker-wrap">
<tiny-date-picker v-model="value" :clearable="false"></tiny-date-picker>
</div>
<br />
<p>自定义清除图标</p>
<br />
<div class="demo-date-picker-wrap">
<tiny-date-picker v-model="value" :clear-icon="IconClose"></tiny-date-picker>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { DatePicker as TinyDatePicker } from '@opentiny/vue'
import { iconClose } from '@opentiny/vue-icon'
const value = ref(new Date('2023-05-24'))
const IconClose = iconClose()
</script>
<style scoped>
.demo-date-picker-wrap {
width: 280px;
}
</style>