From eee874034837c8330434846252160851f8fb74ff Mon Sep 17 00:00:00 2001 From: talktao Date: Fri, 18 Mar 2022 22:36:46 +0800 Subject: [PATCH] =?UTF-8?q?init=EF=BC=9Avant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/vant.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/plugins/vant.ts diff --git a/src/plugins/vant.ts b/src/plugins/vant.ts new file mode 100644 index 0000000..3b43348 --- /dev/null +++ b/src/plugins/vant.ts @@ -0,0 +1,31 @@ +/** + * @author TalkTao + * @description 按需引入Vant +*/ +import { Button, Tabbar, TabbarItem, Sticky, NavBar, Icon, Search, DropdownMenu, DropdownItem, Image, Lazyload, Tabs, Tab, Toast, Field, CellGroup, Form } from 'vant' +const pluginsVant = [ + Button, + Tabbar, + TabbarItem, + Sticky, + NavBar, + Icon, + Search, + DropdownMenu, + DropdownItem, + Image, + Lazyload, + Tabs, + Tab, + Toast, + Field, + CellGroup, + Form +] +export const vantPlugins = { + install: function(vm) { + pluginsVant.forEach((item:any) => { + vm.component(item.name, item); + }); + } +}; \ No newline at end of file