primevue-mirror/doc/calendar/IconDoc.vue

112 lines
4.1 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>
<Calendar 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>
2023-11-28 09:56:21 +00:00
<Calendar v-model="icondisplay" showIcon iconDisplay="input" inputId="icondisplay" />
</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>
2023-11-28 09:56:21 +00:00
<Calendar v-model="templatedisplay" showIcon iconDisplay="input" timeOnly inputId="templatedisplay">
<template #inputicon="{ clickCallback }">
2024-02-01 23:21:00 +00:00
<i class="pi pi-clock cursor-pointer" @click="clickCallback" />
2023-11-28 09:56:21 +00:00
</template>
</Calendar>
</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-02-01 23:21:00 +00:00
<Calendar v-model="buttondisplay" showIcon :showOnFocus="false" />
2023-11-28 09:56:21 +00:00
<Calendar v-model="icondisplay" showIcon iconDisplay="input" />
<Calendar v-model="templatedisplay" showIcon iconDisplay="input" timeOnly>
<template #inputicon="{ clickCallback }">
2024-02-01 23:21:00 +00:00
<i class="pi pi-clock cursor-pointer" @click="clickCallback" />
2023-11-28 09:56:21 +00:00
</template>
</Calendar>
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>
<Calendar 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>
2023-11-28 09:56:21 +00:00
<Calendar v-model="icondisplay" showIcon iconDisplay="input" inputId="icondisplay" />
</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>
2023-11-28 09:56:21 +00:00
<Calendar v-model="templatedisplay" showIcon iconDisplay="input" timeOnly inputId="templatedisplay">
<template #inputicon="{ clickCallback }">
2024-02-01 23:21:00 +00:00
<i class="pi pi-clock cursor-pointer" @click="clickCallback" />
2023-11-28 09:56:21 +00:00
</template>
</Calendar>
</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>
<Calendar 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>
2023-11-28 09:56:21 +00:00
<Calendar v-model="icondisplay" showIcon iconDisplay="input" inputId="icondisplay" />
</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>
2023-11-28 09:56:21 +00:00
<Calendar v-model="templatedisplay" showIcon iconDisplay="input" timeOnly inputId="templatedisplay">
<template #inputicon="{ clickCallback }">
2024-02-01 23:21:00 +00:00
<i class="pi pi-clock cursor-pointer" @click="clickCallback" />
2023-11-28 09:56:21 +00:00
</template>
</Calendar>
</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>