primevue-mirror/doc/inputtext/IconsDoc.vue

109 lines
2.7 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
2024-01-30 08:04:48 +00:00
<p>
A group is created by wrapping the input and icon with the <i>IconField</i> component. Each icon is defined as a child of <i>InputIcon</i> component. In addition, position of the icon can be changed using <i>iconPosition</i> property that
the default value is <i>right</i> and also <i>left</i> option is available.
</p>
2023-02-28 08:29:30 +00:00
</DocSectionText>
<div class="card flex flex-wrap justify-content-center gap-3">
2024-01-30 08:04:48 +00:00
<IconField iconPosition="left">
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
2023-02-28 08:29:30 +00:00
<InputText v-model="value1" placeholder="Search" />
2024-01-30 08:04:48 +00:00
</IconField>
2023-02-28 08:29:30 +00:00
2024-01-30 08:04:48 +00:00
<IconField>
<InputIcon>
<i class="pi pi-spin pi-spinner" />
</InputIcon>
2023-02-28 08:29:30 +00:00
<InputText v-model="value2" />
2024-01-30 08:04:48 +00:00
</IconField>
2023-02-28 08:29:30 +00:00
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value1: null,
value2: null,
code: {
2023-09-22 12:54:14 +00:00
basic: `
2024-01-30 08:04:48 +00:00
<IconField iconPosition="left">
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
2023-02-28 08:29:30 +00:00
<InputText v-model="value1" placeholder="Search" />
2024-01-30 08:04:48 +00:00
</IconField>
2023-02-28 08:29:30 +00:00
2024-01-30 08:04:48 +00:00
<IconField>
<InputIcon>
<i class="pi pi-spin pi-spinner" />
</InputIcon>
2023-02-28 08:29:30 +00:00
<InputText v-model="value2" />
2024-01-30 08:04:48 +00:00
</IconField>
2023-10-15 09:38:39 +00:00
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card flex flex-wrap justify-content-center gap-3">
2024-01-30 08:04:48 +00:00
<IconField iconPosition="left">
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
2023-02-28 08:29:30 +00:00
<InputText v-model="value1" placeholder="Search" />
2024-01-30 08:04:48 +00:00
</IconField>
<IconField>
<InputIcon>
<i class="pi pi-spin pi-spinner" />
</InputIcon>
2023-02-28 08:29:30 +00:00
<InputText v-model="value2" />
2024-01-30 08:04:48 +00:00
</IconField>
2023-02-28 08:29:30 +00:00
</div>
</template>
<script setup>
export default {
data() {
return {
value1: null,
value2: null
}
}
}
2023-10-15 09:38:39 +00:00
<\/script>
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card flex flex-wrap justify-content-center gap-3">
2024-01-30 08:04:48 +00:00
<IconField iconPosition="left">
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
2023-02-28 08:29:30 +00:00
<InputText v-model="value1" placeholder="Search" />
2024-01-30 08:04:48 +00:00
</IconField>
<IconField>
<InputIcon>
2023-02-28 08:29:30 +00:00
<i class="pi pi-spin pi-spinner" />
2024-01-30 08:04:48 +00:00
</InputIcon>
2023-02-28 08:29:30 +00:00
<InputText v-model="value2" />
2024-01-30 08:04:48 +00:00
</IconField>
2023-02-28 08:29:30 +00:00
</div>
</template>
<script setup>
import { ref } from 'vue';
const value1 = ref(null);
const value2 = ref(null);
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>