Commit 4b7138b97fcbbc2fc33c6e00aea676ca91b60495

Authored by 梁灏
1 parent 8a3bad74

fixed some bugs

fixed some bugs
src/components/modal/confirm.js
1 1 import Vue from 'vue';
2 2 import Modal from './modal.vue';
3 3 import Icon from '../icon/icon.vue';
4   -import Button from '../button/button.vue';
  4 +import iButton from '../button/button.vue';
5 5 import { camelcaseToHyphen } from '../../utils/assist';
6 6  
7 7 const prefixCls = 'ivu-modal-confirm';
... ... @@ -26,8 +26,8 @@ Modal.newInstance = properties => {
26 26 {{{ body }}}
27 27 </div>
28 28 <div class="${prefixCls}-footer">
29   - <Button type="ghost" size="large" v-if="showCancel" @click="cancel">{{ cancelText }}</Button>
30   - <Button type="primary" size="large" :loading="buttonLoading" @click="ok">{{ okText }}</Button>
  29 + <i-button type="ghost" size="large" v-if="showCancel" @click="cancel">{{ cancelText }}</i-button>
  30 + <i-button type="primary" size="large" :loading="buttonLoading" @click="ok">{{ okText }}</i-button>
31 31 </div>
32 32 </div>
33 33 </Modal>
... ... @@ -36,7 +36,7 @@ Modal.newInstance = properties =&gt; {
36 36  
37 37 const modal = new Vue({
38 38 el: div,
39   - components: { Modal, Button, Icon },
  39 + components: { Modal, iButton, Icon },
40 40 data: Object.assign(_props, {
41 41 visible: false,
42 42 width: 416,
... ...
src/components/modal/modal.vue
... ... @@ -12,8 +12,8 @@
12 12 <div :class="[prefixCls + '-body']"><slot></slot></div>
13 13 <div :class="[prefixCls + '-footer']" v-if="!footerHide">
14 14 <slot name="footer">
15   - <Button type="ghost" size="large" @click="cancel">{{ cancelText }}</Button>
16   - <Button type="primary" size="large" :loading="buttonLoading" @click="ok">{{ okText }}</Button>
  15 + <i-button type="ghost" size="large" @click="cancel">{{ cancelText }}</i-button>
  16 + <i-button type="primary" size="large" :loading="buttonLoading" @click="ok">{{ okText }}</i-button>
17 17 </slot>
18 18 </div>
19 19 </div>
... ... @@ -22,13 +22,13 @@
22 22 </template>
23 23 <script>
24 24 import Icon from '../icon';
25   - import Button from '../button';
  25 + import iButton from '../button/button.vue';
26 26 import { getScrollBarSize } from '../../utils/assist';
27 27  
28 28 const prefixCls = 'ivu-modal';
29 29  
30 30 export default {
31   - components: { Icon, Button },
  31 + components: { Icon, iButton },
32 32 props: {
33 33 visible: {
34 34 type: Boolean,
... ...
src/components/poptip/poptip.vue
... ... @@ -37,7 +37,7 @@
37 37 </template>
38 38 <script>
39 39 import Popper from '../base/popper';
40   - import Button from '../button/button.vue';
  40 + import iButton from '../button/button.vue';
41 41 import clickoutside from '../../directives/clickoutside';
42 42 import { oneOf } from '../../utils/assist';
43 43  
... ... @@ -46,7 +46,7 @@
46 46 export default {
47 47 mixins: [Popper],
48 48 directives: { clickoutside },
49   - components: { iButton: Button },
  49 + components: { iButton },
50 50 props: {
51 51 trigger: {
52 52 validator (value) {
... ... @@ -92,9 +92,9 @@
92 92 computed: {
93 93 classes () {
94 94 return [
95   - prefixCls + '',
  95 + `${prefixCls}`,
96 96 {
97   - [prefixCls + '-confirm']: this.confirm
  97 + [`${prefixCls}-confirm`]: this.confirm
98 98 }
99 99 ]
100 100 },
... ... @@ -102,7 +102,7 @@
102 102 let style = {};
103 103  
104 104 if (!!this.width) {
105   - style.width = '${this.width}px';
  105 + style.width = `${this.width}px`;
106 106 }
107 107 return style;
108 108 }
... ...
src/components/select/select.vue
... ... @@ -100,14 +100,14 @@
100 100 computed: {
101 101 classes () {
102 102 return [
103   - prefixCls + '',
  103 + `${prefixCls}`,
104 104 {
105   - [prefixCls + '-visible']: this.visible,
106   - [prefixCls + '-disabled']: this.disabled,
107   - [prefixCls + '-multiple']: this.multiple,
108   - [prefixCls + '-single']: !this.multiple,
109   - [prefixCls + '-show-clear']: this.showCloseIcon,
110   - [prefixCls + '-${this.size}']: !!this.size
  105 + [`${prefixCls}-visible`]: this.visible,
  106 + [`${prefixCls}-disabled`]: this.disabled,
  107 + [`${prefixCls}-multiple`]: this.multiple,
  108 + [`${prefixCls}-single`]: !this.multiple,
  109 + [`${prefixCls}-show-clear`]: this.showCloseIcon,
  110 + [`${prefixCls}-${this.size}`]: !!this.size
111 111 }
112 112 ]
113 113 },
... ... @@ -136,7 +136,7 @@
136 136 if (this.showPlaceholder) {
137 137 style.width = '100%';
138 138 } else {
139   - style.width = '${this.inputLength}px';
  139 + style.width = `${this.inputLength}px`;
140 140 }
141 141 }
142 142  
... ...
src/components/tooltip/tooltip.vue
1 1 <template>
2   - <div :class="[prefix]" @mouseenter="handleShowPopper" @mouseleave="handleClosePopper">
3   - <div :class="[prefix + '-rel']" v-el:reference>
  2 + <div :class="[prefixCls]" @mouseenter="handleShowPopper" @mouseleave="handleClosePopper">
  3 + <div :class="[prefixCls + '-rel']" v-el:reference>
4 4 <slot></slot>
5 5 </div>
6   - <div :class="[prefix + '-popper']" transition="fade" v-el:popper v-show="!disabled && visible">
7   - <div :class="[prefix + '-content']">
8   - <div :class="[prefix + '-arrow']"></div>
9   - <div :class="[prefix + '-inner']"><slot name="content">{{ content }}</slot></div>
  6 + <div :class="[prefixCls + '-popper']" transition="fade" v-el:popper v-show="!disabled && visible">
  7 + <div :class="[prefixCls + '-content']">
  8 + <div :class="[prefixCls + '-arrow']"></div>
  9 + <div :class="[prefixCls + '-inner']"><slot name="content">{{ content }}</slot></div>
10 10 </div>
11 11 </div>
12 12 </div>
... ...
src/index.js
... ... @@ -31,6 +31,7 @@ import Slider from &#39;./components/slider&#39;;
31 31  
32 32 const iview = {
33 33 Button,
  34 + iButton: Button,
34 35 ButtonGroup: Button.Group,
35 36 Icon,
36 37 Input,
... ...