primevue-mirror/doc/inputtext/IconsDoc.vue

84 lines
2.3 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Icons can be placed inside an input element by wrapping both the input and the icon with an element that has either <i>.p-input-icon-left</i> or <i>.p-input-icon-right</i> class.</p>
</DocSectionText>
<div class="card flex flex-wrap justify-content-center gap-3">
<span class="p-input-icon-left">
<i class="pi pi-search" />
<InputText v-model="value1" placeholder="Search" />
</span>
<span class="p-input-icon-right">
<i class="pi pi-spin pi-spinner" />
<InputText v-model="value2" />
</span>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value1: null,
value2: null,
code: {
2023-08-16 13:58:31 +00:00
basic: `<span class="p-input-icon-left">
2023-02-28 08:29:30 +00:00
<i class="pi pi-search" />
<InputText v-model="value1" placeholder="Search" />
</span>
<span class="p-input-icon-right">
<i class="pi pi-spin pi-spinner" />
<InputText v-model="value2" />
</span>`,
2023-08-16 13:58:31 +00:00
options: `<template>
2023-02-28 08:29:30 +00:00
<div class="card flex flex-wrap justify-content-center gap-3">
<span class="p-input-icon-left">
<i class="pi pi-search" />
<InputText v-model="value1" placeholder="Search" />
</span>
<span class="p-input-icon-right">
<i class="pi pi-spin pi-spinner" />
<InputText v-model="value2" />
</span>
</div>
</template>
<script setup>
export default {
data() {
return {
value1: null,
value2: null
}
}
}
<\/script>`,
2023-08-16 13:58:31 +00:00
composition: `<template>
2023-02-28 08:29:30 +00:00
<div class="card flex flex-wrap justify-content-center gap-3">
<span class="p-input-icon-left">
<i class="pi pi-search" />
<InputText v-model="value1" placeholder="Search" />
</span>
<span class="p-input-icon-right">
<i class="pi pi-spin pi-spinner" />
<InputText v-model="value2" />
</span>
</div>
</template>
<script setup>
import { ref } from 'vue';
const value1 = ref(null);
const value2 = ref(null);
<\/script>`
}
};
}
};
</script>