fixed some bugs

fixed some bugs
This commit is contained in:
梁灏 2016-10-28 18:27:04 +08:00
parent 8a3bad748c
commit 4b7138b97f
6 changed files with 28 additions and 27 deletions

View file

@ -1,7 +1,7 @@
import Vue from 'vue'; import Vue from 'vue';
import Modal from './modal.vue'; import Modal from './modal.vue';
import Icon from '../icon/icon.vue'; import Icon from '../icon/icon.vue';
import Button from '../button/button.vue'; import iButton from '../button/button.vue';
import { camelcaseToHyphen } from '../../utils/assist'; import { camelcaseToHyphen } from '../../utils/assist';
const prefixCls = 'ivu-modal-confirm'; const prefixCls = 'ivu-modal-confirm';
@ -26,8 +26,8 @@ Modal.newInstance = properties => {
{{{ body }}} {{{ body }}}
</div> </div>
<div class="${prefixCls}-footer"> <div class="${prefixCls}-footer">
<Button type="ghost" size="large" v-if="showCancel" @click="cancel">{{ cancelText }}</Button> <i-button type="ghost" size="large" v-if="showCancel" @click="cancel">{{ cancelText }}</i-button>
<Button type="primary" size="large" :loading="buttonLoading" @click="ok">{{ okText }}</Button> <i-button type="primary" size="large" :loading="buttonLoading" @click="ok">{{ okText }}</i-button>
</div> </div>
</div> </div>
</Modal> </Modal>
@ -36,7 +36,7 @@ Modal.newInstance = properties => {
const modal = new Vue({ const modal = new Vue({
el: div, el: div,
components: { Modal, Button, Icon }, components: { Modal, iButton, Icon },
data: Object.assign(_props, { data: Object.assign(_props, {
visible: false, visible: false,
width: 416, width: 416,

View file

@ -12,8 +12,8 @@
<div :class="[prefixCls + '-body']"><slot></slot></div> <div :class="[prefixCls + '-body']"><slot></slot></div>
<div :class="[prefixCls + '-footer']" v-if="!footerHide"> <div :class="[prefixCls + '-footer']" v-if="!footerHide">
<slot name="footer"> <slot name="footer">
<Button type="ghost" size="large" @click="cancel">{{ cancelText }}</Button> <i-button type="ghost" size="large" @click="cancel">{{ cancelText }}</i-button>
<Button type="primary" size="large" :loading="buttonLoading" @click="ok">{{ okText }}</Button> <i-button type="primary" size="large" :loading="buttonLoading" @click="ok">{{ okText }}</i-button>
</slot> </slot>
</div> </div>
</div> </div>
@ -22,13 +22,13 @@
</template> </template>
<script> <script>
import Icon from '../icon'; import Icon from '../icon';
import Button from '../button'; import iButton from '../button/button.vue';
import { getScrollBarSize } from '../../utils/assist'; import { getScrollBarSize } from '../../utils/assist';
const prefixCls = 'ivu-modal'; const prefixCls = 'ivu-modal';
export default { export default {
components: { Icon, Button }, components: { Icon, iButton },
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,

View file

@ -37,7 +37,7 @@
</template> </template>
<script> <script>
import Popper from '../base/popper'; import Popper from '../base/popper';
import Button from '../button/button.vue'; import iButton from '../button/button.vue';
import clickoutside from '../../directives/clickoutside'; import clickoutside from '../../directives/clickoutside';
import { oneOf } from '../../utils/assist'; import { oneOf } from '../../utils/assist';
@ -46,7 +46,7 @@
export default { export default {
mixins: [Popper], mixins: [Popper],
directives: { clickoutside }, directives: { clickoutside },
components: { iButton: Button }, components: { iButton },
props: { props: {
trigger: { trigger: {
validator (value) { validator (value) {
@ -92,9 +92,9 @@
computed: { computed: {
classes () { classes () {
return [ return [
prefixCls + '', `${prefixCls}`,
{ {
[prefixCls + '-confirm']: this.confirm [`${prefixCls}-confirm`]: this.confirm
} }
] ]
}, },
@ -102,7 +102,7 @@
let style = {}; let style = {};
if (!!this.width) { if (!!this.width) {
style.width = '${this.width}px'; style.width = `${this.width}px`;
} }
return style; return style;
} }

View file

@ -100,14 +100,14 @@
computed: { computed: {
classes () { classes () {
return [ return [
prefixCls + '', `${prefixCls}`,
{ {
[prefixCls + '-visible']: this.visible, [`${prefixCls}-visible`]: this.visible,
[prefixCls + '-disabled']: this.disabled, [`${prefixCls}-disabled`]: this.disabled,
[prefixCls + '-multiple']: this.multiple, [`${prefixCls}-multiple`]: this.multiple,
[prefixCls + '-single']: !this.multiple, [`${prefixCls}-single`]: !this.multiple,
[prefixCls + '-show-clear']: this.showCloseIcon, [`${prefixCls}-show-clear`]: this.showCloseIcon,
[prefixCls + '-${this.size}']: !!this.size [`${prefixCls}-${this.size}`]: !!this.size
} }
] ]
}, },
@ -136,7 +136,7 @@
if (this.showPlaceholder) { if (this.showPlaceholder) {
style.width = '100%'; style.width = '100%';
} else { } else {
style.width = '${this.inputLength}px'; style.width = `${this.inputLength}px`;
} }
} }

View file

@ -1,12 +1,12 @@
<template> <template>
<div :class="[prefix]" @mouseenter="handleShowPopper" @mouseleave="handleClosePopper"> <div :class="[prefixCls]" @mouseenter="handleShowPopper" @mouseleave="handleClosePopper">
<div :class="[prefix + '-rel']" v-el:reference> <div :class="[prefixCls + '-rel']" v-el:reference>
<slot></slot> <slot></slot>
</div> </div>
<div :class="[prefix + '-popper']" transition="fade" v-el:popper v-show="!disabled && visible"> <div :class="[prefixCls + '-popper']" transition="fade" v-el:popper v-show="!disabled && visible">
<div :class="[prefix + '-content']"> <div :class="[prefixCls + '-content']">
<div :class="[prefix + '-arrow']"></div> <div :class="[prefixCls + '-arrow']"></div>
<div :class="[prefix + '-inner']"><slot name="content">{{ content }}</slot></div> <div :class="[prefixCls + '-inner']"><slot name="content">{{ content }}</slot></div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -31,6 +31,7 @@ import Slider from './components/slider';
const iview = { const iview = {
Button, Button,
iButton: Button,
ButtonGroup: Button.Group, ButtonGroup: Button.Group,
Icon, Icon,
Input, Input,