Commit 486116265d418c8521ad785c571983d6e291387f

Authored by 梁灏
1 parent 517917a2

Button support global size

Showing 2 changed files with 5 additions and 1 deletions   Show diff stats
examples/main.js
... ... @@ -12,7 +12,8 @@ import locale from '../src/locale/lang/zh-CN';
12 12 Vue.use(VueRouter);
13 13 Vue.use(iView, {
14 14 locale,
15   - transfer: true
  15 + transfer: true,
  16 + size: 'small'
16 17 });
17 18  
18 19 // 开启debug模式
... ...
src/components/button/button.vue
... ... @@ -47,6 +47,9 @@
47 47 size: {
48 48 validator (value) {
49 49 return oneOf(value, ['small', 'large', 'default']);
  50 + },
  51 + default () {
  52 + return this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
50 53 }
51 54 },
52 55 loading: Boolean,
... ...