Skip to content

Commit

Permalink
fix(Cascader): don't find Popper
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Nov 22, 2020
1 parent 53c6cda commit c9a3308
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion packages/cascader/Cascader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ export default {
'change',
'expand-change',
'active-item-change',
'visible-change'
'visible-change',
'focus',
'blur'
],
props: {
Expand Down
4 changes: 2 additions & 2 deletions packages/popover/vue-popper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { PopupManager } from '../../src/utils/popup'

// const PopperJS = require('element-ui/src/utils/popper')
import PopperJS from '../../src/utils/new-popper'
import { Popper } from '../../src/utils/new-popper'
// const PopperJS = Vue.prototype.$isServer ? function() {} : require('./popper')
const stop = (e) => e.stopPropagation()

Expand Down Expand Up @@ -118,7 +118,7 @@ function useVuePopper(props, { emit, slots, referenceEl }) {
options.placement = currentPlacement.value
options.offset = offset.value
options.arrowOffset = arrowOffset.value
popperJS.value = new PopperJS(referenceRef, popperRef, options)
popperJS.value = new Popper(referenceRef, popperRef, options)
popperJS.value.onCreate(() => {
emit('created', instance.proxy)
resetTransformOrigin()
Expand Down
4 changes: 2 additions & 2 deletions src/use/popper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from 'vue'
import { PopupManager } from '../../src/utils/popup'
// const PopperJS = require('element-ui/src/utils/popper')
import PopperJS from '../../src/utils/new-popper'
import { Popper } from '../../src/utils/new-popper'
const stop = (e) => e.stopPropagation()

const popperProps = {
Expand Down Expand Up @@ -111,7 +111,7 @@ function usePopper(props, { emit, slots }, { referenceElm, popperElm }) {
options.placement = currentPlacement.value
options.offset = offset.value
options.arrowOffset = arrowOffset.value
popperJS.value = new PopperJS(referenceRef, popperRef, options)
popperJS.value = new Popper(referenceRef, popperRef, options)
popperJS.value.onCreate(() => {
emit('created', instance.proxy)
resetTransformOrigin()
Expand Down
2 changes: 1 addition & 1 deletion src/utils/new-popper.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var DEFAULTS = {
* @param {Boolean} [options.removeOnDestroy=false]
* Set to true if you want to automatically remove the popper when you call the `destroy` method.
*/
export default function Popper(reference, popper, options) {
export function Popper(reference, popper, options) {
this._reference = reference.jquery ? reference[0] : reference
this.state = {}

Expand Down
4 changes: 2 additions & 2 deletions src/utils/vue-popper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PopupManager } from '../../src/utils/popup'

import * as PopperJS from './popper'
import { Popper } from '../utils/new-popper'
// const PopperJS = Vue.prototype.$isServer ? function() {} : require('./popper')
const stop = (e) => e.stopPropagation()

Expand Down Expand Up @@ -104,7 +104,7 @@ export default {
options.placement = this.currentPlacement
options.offset = this.offset
options.arrowOffset = this.arrowOffset
this.popperJS = new PopperJS(reference, popper, options)
this.popperJS = new Popper(reference, popper, options)
this.popperJS.onCreate(() => {
this.$emit('created', this)
this.resetTransformOrigin()
Expand Down

0 comments on commit c9a3308

Please sign in to comment.