This commit is contained in:
梁灏 2017-04-10 09:58:51 +08:00
parent b164f7c05c
commit 67c9b1c8b9
6 changed files with 87 additions and 44 deletions

View file

@ -32,12 +32,13 @@
import TransferDom from '../../directives/transfer-dom';
import { getScrollBarSize } from '../../utils/assist';
import Locale from '../../mixins/locale';
import Emitter from '../../mixins/emitter';
const prefixCls = 'ivu-modal';
export default {
name: 'Modal',
mixins: [ Locale ],
mixins: [ Locale, Emitter ],
components: { Icon, iButton },
directives: { TransferDom },
props: {
@ -247,6 +248,7 @@
this.addScrollEffect();
}
}
this.broadcast('Table', 'on-visible-change', val);
},
loading (val) {
if (!val) {

View file

@ -664,6 +664,9 @@
this.fixedHeader();
this.$nextTick(() => this.ready = true);
window.addEventListener('resize', this.handleResize, false);
this.$on('on-visible-change', (val) => {
if (val) this.handleResize();
});
},
beforeDestroy () {
window.removeEventListener('resize', this.handleResize, false);

View file

@ -23,11 +23,13 @@
<script>
import Icon from '../icon/icon.vue';
import { oneOf, getStyle } from '../../utils/assist';
import Emitter from '../../mixins/emitter';
const prefixCls = 'ivu-tabs';
export default {
name: 'Tabs',
mixins: [ Emitter ],
components: { Icon },
props: {
value: {
@ -226,6 +228,7 @@
activeKey () {
this.updateBar();
this.updateStatus();
this.broadcast('Table', 'on-visible-change', true);
}
},
mounted () {

View file

@ -168,14 +168,14 @@ export function scrollTop(el, from = 0, to, duration = 500) {
}
// Find components upward
function findComponentUpward (content, componentName, componentNames) {
function findComponentUpward (context, componentName, componentNames) {
if (typeof componentName === 'string') {
componentNames = [componentName];
} else {
componentNames = componentName;
}
let parent = content.$parent;
let parent = context.$parent;
let name = parent.$options.name;
while (parent && (!name || componentNames.indexOf(name) < 0)) {
parent = parent.$parent;
@ -186,8 +186,8 @@ function findComponentUpward (content, componentName, componentNames) {
export {findComponentUpward};
// Find component downward
function findComponentDownward (content, componentName) {
const childrens = content.$children;
function findComponentDownward (context, componentName) {
const childrens = context.$children;
let children = null;
if (childrens.length) {
@ -215,8 +215,8 @@ function findComponentDownward (content, componentName) {
export {findComponentDownward};
// Find components downward
function findComponentsDownward (content, componentName, components = []) {
const childrens = content.$children;
function findComponentsDownward (context, componentName, components = []) {
const childrens = context.$children;
if (childrens.length) {
childrens.forEach(child => {