parent
16c2b8d26e
commit
7bafe9d94c
15 changed files with 230 additions and 27 deletions
|
@ -7,6 +7,8 @@
|
|||
import { getStyle } from '../../utils/assist';
|
||||
const Popper = isServer ? function() {} : require('popper.js/dist/umd/popper.js'); // eslint-disable-line
|
||||
|
||||
import { transferIndex, transferIncrease } from '../../utils/transfer-queue';
|
||||
|
||||
export default {
|
||||
name: 'Drop',
|
||||
props: {
|
||||
|
@ -16,19 +18,26 @@
|
|||
},
|
||||
className: {
|
||||
type: String
|
||||
},
|
||||
transfer: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
popper: null,
|
||||
width: '',
|
||||
popperStatus: false
|
||||
popperStatus: false,
|
||||
tIndex: this.handleGetIndex()
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
styles () {
|
||||
let style = {};
|
||||
if (this.width) style.minWidth = `${this.width}px`;
|
||||
|
||||
if (this.transfer) style['z-index'] = 1060 + this.tIndex;
|
||||
|
||||
return style;
|
||||
}
|
||||
},
|
||||
|
@ -66,6 +75,7 @@
|
|||
if (this.$parent.$options.name === 'iSelect') {
|
||||
this.width = parseInt(getStyle(this.$parent.$el, 'width'));
|
||||
}
|
||||
this.tIndex = this.handleGetIndex();
|
||||
},
|
||||
destroy () {
|
||||
if (this.popper) {
|
||||
|
@ -89,7 +99,11 @@
|
|||
if(!leftOrRight){
|
||||
this.popper.popper.style.transformOrigin = placementStart==='bottom' || ( placementStart !== 'top' && placementEnd === 'start') ? 'center top' : 'center bottom';
|
||||
}
|
||||
}
|
||||
},
|
||||
handleGetIndex () {
|
||||
transferIncrease();
|
||||
return transferIndex;
|
||||
},
|
||||
},
|
||||
created () {
|
||||
this.$on('on-update-popper', this.update);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue