From 486116265d418c8521ad785c571983d6e291387f Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Thu, 28 Jun 2018 11:52:37 +0800 Subject: [PATCH] Button support global size --- examples/main.js | 3 ++- src/components/button/button.vue | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/main.js b/examples/main.js index 54abbbd..9661399 100644 --- a/examples/main.js +++ b/examples/main.js @@ -12,7 +12,8 @@ import locale from '../src/locale/lang/zh-CN'; Vue.use(VueRouter); Vue.use(iView, { locale, - transfer: true + transfer: true, + size: 'small' }); // 开启debug模式 diff --git a/src/components/button/button.vue b/src/components/button/button.vue index 81228bc..55eb78f 100644 --- a/src/components/button/button.vue +++ b/src/components/button/button.vue @@ -47,6 +47,9 @@ size: { validator (value) { return oneOf(value, ['small', 'large', 'default']); + }, + default () { + return this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size; } }, loading: Boolean, -- libgit2 0.21.4