feat: add @vant/use

This commit is contained in:
chenjiahan
2020-09-10 21:03:53 +08:00
parent 14c1d4ea77
commit dbc6b92868
5 changed files with 1912 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
import { ref } from 'vue';
export function useToggle(defaultValue = false) {
const state = ref(defaultValue);
const toggle = (value = !state.value) => {
state.value = value;
};
return [state, toggle];
}