Appearance
Appearance
Element Plus 的 el-time-select 组件分发器,添加了只读功能。
<template>
<el-time-select-dispatcher
v-model="value"
style="width: 240px"
start="08:30"
step="00:15"
end="18:30"
placeholder="Select time"
/>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const value = ref('')
</script>
使用 format 属性来控制时间格式 (小时以及分钟)。
<template>
<el-time-select-dispatcher
v-model="value"
style="width: 240px"
start="00:00"
step="00:30"
end="23:59"
placeholder="Select time"
format="hh:mm A"
/>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const value = ref('')
</script>
使用 slots 中的 ${Config.namespace}Reader, ${Config.namespace}Writer 覆盖读写状态渲染函数。
<template>
<el-time-select-dispatcher
v-model="value"
style="width: 240px"
start="08:30"
step="00:15"
end="18:30"
placeholder="Select time"
>
<template #[`${Config.namespace}Reader`]>
<span style="color: green" key="reader">reader: {{ value }}</span>
</template>
<template #[`${Config.namespace}Writer`]>
<span style="color: red" key="writer">writer: {{ value }}</span>
</template>
</el-time-select-dispatcher>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { Config } from "element-plus-form-dispatcher";
const value = ref("");
</script>
与 el-time-select 的 props attrs slots 完全一致