pull/165/head
tangjinzhou 7 years ago
parent 025af67deb
commit c558e66aa1

@ -1,3 +1,17 @@
const parseStyleText = (cssText = '') => {
const res = {}
const listDelimiter = /;(?![^(]*\))/g
const propertyDelimiter = /:(.+)/
cssText.split(listDelimiter).forEach(function (item) {
if (item) {
const tmp = item.split(propertyDelimiter)
tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim())
}
})
return res
}
const hasProp = (instance, prop) => {
const $options = instance.$options || {}
const propsData = $options.propsData || {}
@ -106,7 +120,7 @@ export function getStyle (ele) {
} else if (ele.$vnode && ele.$vnode.data) {
data = ele.$vnode.data
}
return data.style || data.staticStyle
return data.style || parseStyleText(data.staticStyle || '')
}
export function getComponentName (opts) {

@ -7,6 +7,7 @@ import placements from './placements'
import { loopMenuItemRecusively, noop } from './util'
import BaseMixin from '../_util/BaseMixin'
import { getComponentFromProp } from '../_util/props-util'
import { requestAnimationTimeout, cancelAnimationTimeout } from '../_util/requestAnimationTimeout'
let guid = 0
@ -73,10 +74,10 @@ export default {
// this.clearSubMenuTimers()
// }
if (this.minWidthTimeout) {
clearTimeout(this.minWidthTimeout)
cancelAnimationTimeout(this.minWidthTimeout)
}
if (this.mouseenterTimeout) {
clearTimeout(this.mouseenterTimeout)
cancelAnimationTimeout(this.mouseenterTimeout)
}
},
methods: {
@ -86,7 +87,7 @@ export default {
return
}
const self = this
this.minWidthTimeout = setTimeout(() => {
this.minWidthTimeout = requestAnimationTimeout(() => {
if (!self.$refs.subMenuTitle || !self.$refs.menuInstance) {
return
}
@ -282,7 +283,7 @@ export default {
}
if (type === 'mouseenter') {
// make sure mouseenter happen after other menu item's mouseleave
this.mouseenterTimeout = setTimeout(() => {
this.mouseenterTimeout = requestAnimationTimeout(() => {
openChange()
}, 0)
} else {

@ -18,7 +18,7 @@ message | done
Select | done
Input | done
InputNumber
AutoComplete
AutoComplete | done
Modal
Alert
Calendar

Loading…
Cancel
Save