primevue-mirror/apps/showcase/doc/autocomplete/pt/PTViewer.vue

32 lines
752 B
Vue
Raw Permalink Normal View History

2024-09-19 06:55:07 +00:00
<template>
<DocPTViewer :docs="docs">
<AutoComplete v-model="value" dropdown :suggestions="items" @complete="search" appendTo="self" />
</DocPTViewer>
</template>
<script>
import { getPTOptions } from '@/components/doc/helpers';
export default {
data() {
return {
value: '',
items: [],
docs: [
{
data: getPTOptions('AutoComplete'),
key: 'AutoComplete'
}
]
};
},
methods: {
search(event) {
let _items = [...Array(10).keys()];
this.items = event.query ? [...Array(10).keys()].map((item) => event.query + '-' + item) : _items;
}
}
};
</script>