fect-org / fect

Minimalist UI components built on Vue-next

Home Page:https://www.fect-org.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Controlled questions about form components

nonzzz opened this issue Β· comments

commented

Feature request πŸš€

  • It's just a suggestion
  • we will provide props value for all form components like switch,checkbox,rating and so on

Expected:

  • Perfect compatibility
  • Can use props value control component or use v-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 .