Controlled questions about form components
nonzzz opened this issue Β· comments
kanno commented
Feature request π
- It's just a suggestion
- we will provide props
value
for all form components likeswitch
,checkbox
,rating
and so on
Expected:
- Perfect compatibility
- Can use props
value
control component or usev-model
change state automatically.
Examples:
<template>
<div>
<fe-switch :value="checked" @change="changeHandler" />
</div>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
const checked = ref(true)
const changeHandler = (e) => {
checked.value = e.target.checked
}
return {
checked,
changeHandler,
}
},
}
</script>
Programme:
None .