-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(vue/Field): expose v-model at form element
- Loading branch information
1 parent
2354033
commit a1c5ed3
Showing
10 changed files
with
80 additions
and
13 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,18 +1,34 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import Input from './examples/input.vue' | ||
import Select from './examples/select.vue' | ||
import Textarea from './examples/textarea.vue' | ||
const inputModel = ref('This input is controlled') | ||
const selectModel = ref(3) | ||
const textareaModel = ref(['This is some text', 'then more text']) | ||
</script> | ||
<template> | ||
<Story title="Field"> | ||
<Variant title="Input"> | ||
<Input /> | ||
</Variant> | ||
<Variant title="Input Controlled"> | ||
<span>Input value: {{ inputModel }}</span> | ||
<Input v-model="inputModel" /> | ||
</Variant> | ||
<Variant title="Select"> | ||
<Select /> | ||
</Variant> | ||
<Variant title="Select Controlled"> | ||
<span>Selected: Option {{ selectModel }}</span> | ||
<Select v-model="selectModel" /> | ||
</Variant> | ||
<Variant title="Textarea"> | ||
<Textarea /> | ||
</Variant> | ||
<Variant title="Textarea Controlled"> | ||
<span>Textarea value: {{ textareaModel }}</span> | ||
<Textarea v-model="textareaModel" /> | ||
</Variant> | ||
</Story> | ||
</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