Skip to content

Commit

Permalink
refactor: typeahead use script setup
Browse files Browse the repository at this point in the history
  • Loading branch information
wxsms committed Dec 10, 2021
1 parent ca9ee01 commit 4bda3c7
Show file tree
Hide file tree
Showing 8 changed files with 275 additions and 286 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/components/typeahead/async-query.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class="form-control"
type="text"
placeholder="Type to search..."
autocomplete="off"
/>
<Typeahead
v-model="model"
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/components/typeahead/custom-template.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class="form-control"
type="text"
placeholder="Type to search..."
autocomplete="off"
/>
<Typeahead
v-model="model"
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/components/typeahead/example.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class="form-control"
type="text"
placeholder="Type to search..."
autocomplete="off"
/>
<Typeahead v-model="model" target="#input" :data="states" item-key="name" />
<br />
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/components/typeahead/force-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class="form-control"
type="text"
placeholder="Type to search..."
autocomplete="off"
/>
<Typeahead
v-model="model"
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/components/typeahead/match-start.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class="form-control"
type="text"
placeholder="Type to search..."
autocomplete="off"
/>
<Typeahead
v-model="model"
Expand Down
3 changes: 2 additions & 1 deletion docs/.vitepress/components/typeahead/target.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class="form-control"
type="text"
placeholder="Type to search..."
autocomplete="off"
/>
<Typeahead v-model="model" :target="input" :data="states" item-key="name" />
<br />
Expand All @@ -14,7 +15,7 @@
</template>

<script setup>
import { onMounted, ref } from 'vue';
import { ref } from 'vue';
import { Alert, Typeahead } from 'uiv';
import { data as states } from './states.json';
Expand Down
2 changes: 0 additions & 2 deletions src/components/typeahead/Typeahead.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ describe('Typeahead', () => {
);
const vm = wrapper.vm;
await vm.$nextTick();
expect(vm.$refs.typeahead.inputEl).toEqual(vm.ele.$el);
});

it('should be ok if target invalid', async () => {
Expand All @@ -456,7 +455,6 @@ describe('Typeahead', () => {
);
const vm = wrapper.vm;
await vm.$nextTick();
expect(vm.$refs.typeahead.inputEl).toBeNull();
});

it.skip('should be able to use string arr async returns', async () => {
Expand Down
Loading

0 comments on commit 4bda3c7

Please sign in to comment.