2023-02-28 08:29:30 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
|
|
|
<p>Buttons can be placed at either side of an input element.</p>
|
|
|
|
</DocSectionText>
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="card flex flex-col md:flex-row gap-4">
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
<Button label="Search" />
|
|
|
|
<InputText placeholder="Keyword" />
|
2023-11-06 10:38:32 +00:00
|
|
|
</InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
<InputText placeholder="Keyword" />
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-search" severity="secondary" variant="text" @click="toggle" />
|
|
|
|
</InputGroupAddon>
|
2023-11-06 10:38:32 +00:00
|
|
|
</InputGroup>
|
2024-10-31 16:43:17 +00:00
|
|
|
<Menu ref="menu" :model="items" popup class="!min-w-fit" />
|
2023-02-28 08:29:30 +00:00
|
|
|
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-check" severity="secondary" />
|
|
|
|
</InputGroupAddon>
|
2023-02-28 08:29:30 +00:00
|
|
|
<InputText placeholder="Vote" />
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-times" severity="secondary" />
|
|
|
|
</InputGroupAddon>
|
2023-11-06 10:38:32 +00:00
|
|
|
</InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
2024-10-31 16:43:17 +00:00
|
|
|
items: [{ label: 'Web Search' }, { label: 'AI Assistant' }, { label: 'History' }],
|
2023-02-28 08:29:30 +00:00
|
|
|
code: {
|
2023-09-22 12:54:14 +00:00
|
|
|
basic: `
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
<Button label="Search" />
|
|
|
|
<InputText placeholder="Keyword" />
|
2023-11-06 10:38:32 +00:00
|
|
|
</InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
<InputText placeholder="Keyword" />
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-search" severity="secondary" variant="text" @click="toggle" />
|
|
|
|
</InputGroupAddon>
|
2023-11-06 10:38:32 +00:00
|
|
|
</InputGroup>
|
2024-10-31 16:43:17 +00:00
|
|
|
<Menu ref="menu" :model="items" popup class="!min-w-fit" />
|
2023-02-28 08:29:30 +00:00
|
|
|
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-check" severity="secondary" />
|
|
|
|
</InputGroupAddon>
|
2023-02-28 08:29:30 +00:00
|
|
|
<InputText placeholder="Vote" />
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-times" severity="secondary" />
|
|
|
|
</InputGroupAddon>
|
2023-11-06 10:38:32 +00:00
|
|
|
</InputGroup>
|
2023-10-15 09:38:39 +00:00
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
options: `
|
|
|
|
<template>
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="card flex flex-col md:flex-row gap-4">
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
<Button label="Search" />
|
|
|
|
<InputText placeholder="Keyword" />
|
2023-11-06 10:38:32 +00:00
|
|
|
</InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
<InputText placeholder="Keyword" />
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-search" severity="secondary" variant="text" @click="toggle" />
|
|
|
|
</InputGroupAddon>
|
2023-11-06 10:38:32 +00:00
|
|
|
</InputGroup>
|
2024-10-31 16:43:17 +00:00
|
|
|
<Menu ref="menu" :model="items" popup class="!min-w-fit" />
|
2023-02-28 08:29:30 +00:00
|
|
|
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-check" severity="secondary" />
|
|
|
|
</InputGroupAddon>
|
2023-02-28 08:29:30 +00:00
|
|
|
<InputText placeholder="Vote" />
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-times" severity="secondary" />
|
|
|
|
</InputGroupAddon>
|
2023-11-06 10:38:32 +00:00
|
|
|
</InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
2023-10-15 09:38:39 +00:00
|
|
|
</template>
|
2024-10-31 16:43:17 +00:00
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
items: [{ label: 'Web Search' }, { label: 'AI Assistant' }, { label: 'History' }],
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggle(event) {
|
|
|
|
this.$refs.menu.toggle(event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
<\/script>
|
2023-10-15 09:38:39 +00:00
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
composition: `
|
|
|
|
<template>
|
2024-05-20 12:14:38 +00:00
|
|
|
<div class="card flex flex-col md:flex-row gap-4">
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
<Button label="Search" />
|
|
|
|
<InputText placeholder="Keyword" />
|
2023-11-14 11:05:02 +00:00
|
|
|
</InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
<InputText placeholder="Keyword" />
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-search" severity="secondary" variant="text" @click="toggle" />
|
|
|
|
</InputGroupAddon>
|
2023-11-14 11:05:02 +00:00
|
|
|
</InputGroup>
|
2024-10-31 16:43:17 +00:00
|
|
|
<Menu ref="menu" :model="items" popup class="!min-w-fit" />
|
2023-02-28 08:29:30 +00:00
|
|
|
|
2023-11-06 10:38:32 +00:00
|
|
|
<InputGroup>
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-check" severity="secondary" />
|
|
|
|
</InputGroupAddon>
|
2023-02-28 08:29:30 +00:00
|
|
|
<InputText placeholder="Vote" />
|
2024-10-31 16:43:17 +00:00
|
|
|
<InputGroupAddon>
|
|
|
|
<Button icon="pi pi-times" severity="secondary" />
|
|
|
|
</InputGroupAddon>
|
2023-11-14 11:05:02 +00:00
|
|
|
</InputGroup>
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
2023-10-26 17:53:11 +00:00
|
|
|
</template>
|
2024-10-31 16:43:17 +00:00
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
const menu = ref();
|
|
|
|
const items = ref([{ label: 'Web Search' }, { label: 'AI Assistant' }, { label: 'History' }]);
|
|
|
|
|
|
|
|
const toggle = (event) => {
|
|
|
|
menu.value.toggle(event);
|
|
|
|
};
|
|
|
|
<\/script>
|
2023-10-26 17:53:11 +00:00
|
|
|
`
|
2023-02-28 08:29:30 +00:00
|
|
|
}
|
|
|
|
};
|
2024-10-31 16:43:17 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggle(event) {
|
|
|
|
this.$refs.menu.toggle(event);
|
|
|
|
}
|
2023-02-28 08:29:30 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|