fix
parent
e8daeb3f26
commit
90fd428942
|
@ -8,10 +8,12 @@ import warning from '../_util/warning'
|
||||||
import Item from './MenuItem'
|
import Item from './MenuItem'
|
||||||
import { hasProp } from '../_util/props-util'
|
import { hasProp } from '../_util/props-util'
|
||||||
import BaseMixin from '../_util/BaseMixin'
|
import BaseMixin from '../_util/BaseMixin'
|
||||||
|
import commonPropsType from './src/commonPropsType'
|
||||||
|
|
||||||
export const MenuMode = PropTypes.oneOf(['vertical', 'vertical-left', 'vertical-right', 'horizontal', 'inline'])
|
export const MenuMode = PropTypes.oneOf(['vertical', 'vertical-left', 'vertical-right', 'horizontal', 'inline'])
|
||||||
|
|
||||||
export const menuProps = {
|
export const menuProps = {
|
||||||
|
...commonPropsType,
|
||||||
theme: PropTypes.oneOf(['light', 'dark']).def('light'),
|
theme: PropTypes.oneOf(['light', 'dark']).def('light'),
|
||||||
mode: MenuMode.def('vertical'),
|
mode: MenuMode.def('vertical'),
|
||||||
selectable: PropTypes.bool,
|
selectable: PropTypes.bool,
|
||||||
|
|
|
@ -8,11 +8,8 @@ import commonPropsType from './commonPropsType'
|
||||||
const Menu = {
|
const Menu = {
|
||||||
name: 'Menu',
|
name: 'Menu',
|
||||||
props: {
|
props: {
|
||||||
getPopupContainer: PropTypes.func,
|
|
||||||
openTransitionName: PropTypes.string,
|
|
||||||
forceSubMenuRender: PropTypes.bool,
|
|
||||||
selectable: PropTypes.bool.def(true),
|
|
||||||
...commonPropsType,
|
...commonPropsType,
|
||||||
|
selectable: PropTypes.bool.def(true),
|
||||||
},
|
},
|
||||||
mixins: [BaseMixin, MenuMixin],
|
mixins: [BaseMixin, MenuMixin],
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
import PropTypes from '../../_util/vue-types'
|
// import PropTypes from '../../_util/vue-types'
|
||||||
import MenuMixin from './MenuMixin'
|
import MenuMixin from './MenuMixin'
|
||||||
import BaseMixin from '../../_util/BaseMixin'
|
import BaseMixin from '../../_util/BaseMixin'
|
||||||
import commonPropsType from './commonPropsType'
|
import commonPropsType from './commonPropsType'
|
||||||
import { noop } from './util'
|
// import { noop } from './util'
|
||||||
export default {
|
export default {
|
||||||
name: 'SubPopupMenu',
|
name: 'SubPopupMenu',
|
||||||
props: { ...commonPropsType,
|
props: { ...commonPropsType,
|
||||||
|
@ -51,6 +51,12 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
render () {
|
render () {
|
||||||
|
const props = this.$props
|
||||||
|
|
||||||
|
this.haveOpened = this.haveOpened || props.visible || props.forceSubMenuRender
|
||||||
|
if (!this.haveOpened) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
const { prefixCls } = this.$props
|
const { prefixCls } = this.$props
|
||||||
return this.renderRoot({ ...this.$props, class: `${prefixCls}-sub` }, this.$slots.default)
|
return this.renderRoot({ ...this.$props, class: `${prefixCls}-sub` }, this.$slots.default)
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,10 +13,13 @@ export default {
|
||||||
openAnimation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
openAnimation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
||||||
mode: PropTypes.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']).def('vertical'),
|
mode: PropTypes.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']).def('vertical'),
|
||||||
triggerSubMenuAction: PropTypes.string.def('hover'),
|
triggerSubMenuAction: PropTypes.string.def('hover'),
|
||||||
openTransitionName: PropTypes.string,
|
|
||||||
subMenuOpenDelay: PropTypes.number.def(0.1),
|
subMenuOpenDelay: PropTypes.number.def(0.1),
|
||||||
subMenuCloseDelay: PropTypes.number.def(0.1),
|
subMenuCloseDelay: PropTypes.number.def(0.1),
|
||||||
level: PropTypes.number.def(1),
|
level: PropTypes.number.def(1),
|
||||||
inlineIndent: PropTypes.number.def(24),
|
inlineIndent: PropTypes.number.def(24),
|
||||||
theme: PropTypes.oneOf(['light', 'dark']).def('light'),
|
theme: PropTypes.oneOf(['light', 'dark']).def('light'),
|
||||||
|
getPopupContainer: PropTypes.func,
|
||||||
|
openTransitionName: PropTypes.string,
|
||||||
|
forceSubMenuRender: PropTypes.bool,
|
||||||
|
selectable: PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue