From df0a055ce6d49c35a2b0fcba461d538c69d76503 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Thu, 10 Sep 2020 21:15:16 +0800 Subject: [PATCH] chore: install @vant/use --- package.json | 1 + src/calendar/components/Month.js | 2 +- src/composition/use-toggle.ts | 10 ---------- yarn.lock | 5 +++++ 4 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 src/composition/use-toggle.ts diff --git a/package.json b/package.json index 00cdfcfe8..06be8b458 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "dependencies": { "@babel/runtime": "7.x", "@vant/icons": "1.3.0", + "@vant/use": "^0.0.1-alpha.1", "vue-lazyload": "1.2.3" }, "peerDependencies": { diff --git a/src/calendar/components/Month.js b/src/calendar/components/Month.js index b07965fa9..bbcd2bb29 100644 --- a/src/calendar/components/Month.js +++ b/src/calendar/components/Month.js @@ -16,8 +16,8 @@ import { } from '../utils'; // Composition +import { useToggle } from '@vant/use'; import { useHeight } from '../../composition/use-rect'; -import { useToggle } from '../../composition/use-toggle'; import { usePublicApi } from '../../composition/use-public-api'; // Components diff --git a/src/composition/use-toggle.ts b/src/composition/use-toggle.ts deleted file mode 100644 index bd6a281be..000000000 --- a/src/composition/use-toggle.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ref } from 'vue'; - -export function useToggle(defaultValue = false) { - const state = ref(defaultValue); - const setState = (value: boolean) => { - state.value = value; - }; - - return [state, setState]; -} diff --git a/yarn.lock b/yarn.lock index a03d8fbcd..85ec049c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2156,6 +2156,11 @@ resolved "https://registry.yarnpkg.com/@vant/touch-emulator/-/touch-emulator-1.2.0.tgz#486300b23e57db9ce9231a04e0a0c621c68692d8" integrity sha512-sJ97zU85zOq51qoi7+CpBEcOyH3CitjP1KC7/GQwqaurUJni+EP7/F9n0HMnAh8GXMjgtgDBNJ5z48x+coNKYQ== +"@vant/use@^0.0.1-alpha.1": + version "0.0.1-alpha.1" + resolved "https://registry.npmjs.org/@vant/use/-/use-0.0.1-alpha.1.tgz#2c8242c86a75be7b9a3965f412c737b249906858" + integrity sha512-dtem5ThlklkoP4zs7BuLzwYgC6OxHsUH/Upme3ep426pfuF7nowlZvF/BnOA+v9ki5BHD48sXaeVhaEqtWC7Ig== + "@vue/babel-helper-vue-transform-on@^1.0.0-rc.2": version "1.0.0-rc.2" resolved "https://registry.npmjs.org/@vue/babel-helper-vue-transform-on/-/babel-helper-vue-transform-on-1.0.0-rc.2.tgz#7246341f666e7c6e65b13da420e2ce85714fbbca"