-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(select): add type generics | add unit tests (#963)
* feat(select): add type generics | update examples * test(select): add select tests
- Loading branch information
Showing
13 changed files
with
379 additions
and
128 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
const selected = ref([]); | ||
</script> | ||
|
||
<template> | ||
<section> | ||
<o-field> | ||
<o-select | ||
v-model="selected" | ||
placeholder="Select a character" | ||
icon="user"> | ||
<optgroup label="Black Sails"> | ||
<option value="flint">Flint</option> | ||
<option value="silver">Silver</option> | ||
<option value="vane">Vane</option> | ||
<option value="billy">Billy</option> | ||
<option value="jack">Jack</option> | ||
</optgroup> | ||
|
||
<optgroup label="Breaking Bad"> | ||
<option value="heisenberg">Heisenberg</option> | ||
<option value="jesse">Jesse</option> | ||
<option value="saul">Saul</option> | ||
<option value="mike">Mike</option> | ||
</optgroup> | ||
|
||
<optgroup label="Game of Thrones"> | ||
<option value="tyrion-lannister">Tyrion Lannister</option> | ||
<option value="jamie-lannister">Jamie Lannister</option> | ||
<option value="daenerys-targaryen"> | ||
Daenerys Targaryen | ||
</option> | ||
<option value="jon-snow">Jon Snow</option> | ||
</optgroup> | ||
</o-select> | ||
</o-field> | ||
|
||
<p><b>Selected:</b> {{ selected }}</p> | ||
</section> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/oruga/src/components/select/examples/multiple.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
const selected = ref([]); | ||
</script> | ||
|
||
<template> | ||
<section> | ||
<o-field label="Multiple"> | ||
<o-select v-model="selected" multiple native-size="8"> | ||
<option value="flint">Flint</option> | ||
<option value="silver">Silver</option> | ||
<option value="vane">Vane</option> | ||
<option value="billy">Billy</option> | ||
<option value="jack">Jack</option> | ||
<option value="heisenberg">Heisenberg</option> | ||
<option value="jesse">Jesse</option> | ||
<option value="saul">Saul</option> | ||
<option value="mike">Mike</option> | ||
</o-select> | ||
</o-field> | ||
|
||
<p><b>Selected:</b> {{ selected }}</p> | ||
</section> | ||
</template> |
Oops, something went wrong.