support Nuxt.js

This commit is contained in:
梁灏 2017-07-10 15:36:09 +08:00
parent 825ed58099
commit a68c11a565
4 changed files with 16 additions and 4 deletions

View file

@ -2,8 +2,10 @@
<div class="ivu-select-dropdown" :style="styles"><slot></slot></div>
</template>
<script>
import Vue from 'vue';
const isServer = Vue.prototype.$isServer;
import { getStyle } from '../../utils/assist';
import Popper from 'popper.js';
const Popper = isServer ? function() {} : require('popper.js'); // eslint-disable-line
export default {
name: 'Drop',
@ -28,6 +30,7 @@
},
methods: {
update () {
if (isServer) return;
if (this.popper) {
this.$nextTick(() => {
this.popper.update();