primevue-mirror/doc/datepicker/IconDoc.vue

112 lines
4.2 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
2024-02-01 23:21:00 +00:00
<p>An additional icon is displayed next to the input field when <i>showIcon</i> is present.</p>
2023-02-28 08:29:30 +00:00
</DocSectionText>
2023-11-28 09:56:21 +00:00
<div class="card flex flex-wrap gap-3 p-fluid">
<div class="flex-auto">
2024-02-01 23:21:00 +00:00
<label for="buttondisplay" class="font-bold block mb-2"> Button </label>
2024-04-18 14:22:30 +00:00
<DatePicker v-model="buttondisplay" showIcon :showOnFocus="false" inputId="buttondisplay" />
2023-11-28 09:56:21 +00:00
</div>
<div class="flex-auto">
2024-02-01 23:21:00 +00:00
<label for="icondisplay" class="font-bold block mb-2"> Default Icon </label>
2024-04-18 14:22:30 +00:00
<DatePicker v-model="icondisplay" showIcon iconDisplay="input" inputId="icondisplay" />
2023-11-28 09:56:21 +00:00
</div>
<div class="flex-auto">
2024-02-01 23:21:00 +00:00
<label for="templatedisplay" class="font-bold block mb-2"> Custom Icon </label>
2024-04-18 14:22:30 +00:00
<DatePicker v-model="templatedisplay" showIcon iconDisplay="input" timeOnly inputId="templatedisplay">
2024-05-15 06:16:06 +00:00
<template #inputicon="slotProps">
<InputIcon class="pi pi-clock" :class="slotProps.class" @click="slotProps.clickCallback" />
2023-11-28 09:56:21 +00:00
</template>
2024-04-18 14:22:30 +00:00
</DatePicker>
2023-11-28 09:56:21 +00:00
</div>
2023-02-28 08:29:30 +00:00
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
2023-11-28 09:56:21 +00:00
buttondisplay: null,
icondisplay: null,
templatedisplay: null,
2023-02-28 08:29:30 +00:00
code: {
2023-09-22 12:54:14 +00:00
basic: `
2024-04-18 14:22:30 +00:00
<DatePicker v-model="buttondisplay" showIcon :showOnFocus="false" />
<DatePicker v-model="icondisplay" showIcon iconDisplay="input" />
<DatePicker v-model="templatedisplay" showIcon iconDisplay="input" timeOnly>
2024-05-15 06:16:06 +00:00
<template #inputicon="slotProps">
<InputIcon class="pi pi-clock" :class="slotProps.class" @click="slotProps.clickCallback" />
2023-11-28 09:56:21 +00:00
</template>
2024-04-18 14:22:30 +00:00
</DatePicker>
2023-10-15 09:38:39 +00:00
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-11-28 09:56:21 +00:00
<div class="card flex flex-wrap gap-3 p-fluid">
<div class="flex-auto">
2024-02-01 23:21:00 +00:00
<label for="buttondisplay" class="font-bold block mb-2"> Button </label>
2024-04-18 14:22:30 +00:00
<DatePicker v-model="buttondisplay" showIcon :showOnFocus="false" inputId="buttondisplay" />
2023-11-28 09:56:21 +00:00
</div>
<div class="flex-auto">
2024-02-01 23:21:00 +00:00
<label for="icondisplay" class="font-bold block mb-2"> Default Icon </label>
2024-04-18 14:22:30 +00:00
<DatePicker v-model="icondisplay" showIcon iconDisplay="input" inputId="icondisplay" />
2023-11-28 09:56:21 +00:00
</div>
<div class="flex-auto">
2024-02-01 23:21:00 +00:00
<label for="templatedisplay" class="font-bold block mb-2"> Custom Icon </label>
2024-04-18 14:22:30 +00:00
<DatePicker v-model="templatedisplay" showIcon iconDisplay="input" timeOnly inputId="templatedisplay">
2024-05-15 06:16:06 +00:00
<template #inputicon="slotProps">
<InputIcon class="pi pi-clock" :class="slotProps.class" @click="slotProps.clickCallback" />
2023-11-28 09:56:21 +00:00
</template>
2024-04-18 14:22:30 +00:00
</DatePicker>
2023-11-28 09:56:21 +00:00
</div>
2023-02-28 08:29:30 +00:00
</div>
</template>
<script>
export default {
data() {
return {
2023-11-28 09:56:21 +00:00
buttondisplay: null,
icondisplay: null,
templatedisplay: null,
2023-02-28 08:29:30 +00:00
};
}
};
2023-10-15 09:38:39 +00:00
<\/script>
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2023-11-28 09:56:21 +00:00
<div class="card flex flex-wrap gap-3 p-fluid">
<div class="flex-auto">
2024-02-01 23:21:00 +00:00
<label for="buttondisplay" class="font-bold block mb-2"> Button </label>
2024-04-18 14:22:30 +00:00
<DatePicker v-model="buttondisplay" showIcon :showOnFocus="false" inputId="buttondisplay" />
2023-11-28 09:56:21 +00:00
</div>
<div class="flex-auto">
2024-02-01 23:21:00 +00:00
<label for="icondisplay" class="font-bold block mb-2"> Default Icon </label>
2024-04-18 14:22:30 +00:00
<DatePicker v-model="icondisplay" showIcon iconDisplay="input" inputId="icondisplay" />
2023-11-28 09:56:21 +00:00
</div>
<div class="flex-auto">
2024-02-01 23:21:00 +00:00
<label for="templatedisplay" class="font-bold block mb-2"> Custom Icon </label>
2024-04-18 14:22:30 +00:00
<DatePicker v-model="templatedisplay" showIcon iconDisplay="input" timeOnly inputId="templatedisplay">
2024-05-15 06:16:06 +00:00
<template #inputicon="slotProps">
<InputIcon class="pi pi-clock" :class="slotProps.class" @click="slotProps.clickCallback" />
2023-11-28 09:56:21 +00:00
</template>
2024-04-18 14:22:30 +00:00
</DatePicker>
2023-11-28 09:56:21 +00:00
</div>
2023-02-28 08:29:30 +00:00
</div>
</template>
<script setup>
import { ref } from "vue";
2023-11-28 09:56:21 +00:00
const buttondisplay = ref();
const icondisplay = ref();
const templatedisplay = ref();
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>