fix: update Menu type (#3173)

* fix: update Menu type

* update
pull/3179/head
ajuner 2020-11-14 20:48:35 +08:00 committed by GitHub
parent b84b981799
commit e7fbaacf3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ export const menuProps = {
mode: MenuMode.def('vertical'), mode: MenuMode.def('vertical'),
selectable: PropTypes.looseBool, selectable: PropTypes.looseBool,
selectedKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), selectedKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
defaultSelectedKeys: PropTypes.array, defaultSelectedKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
openKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), openKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
defaultOpenKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), defaultOpenKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
openAnimation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), openAnimation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
@ -158,14 +158,14 @@ const Menu = defineComponent({
this.restoreModeVerticalFromInline(); this.restoreModeVerticalFromInline();
this.$emit('mouseenter', e); this.$emit('mouseenter', e);
}, },
handleTransitionEnd(e) { handleTransitionEnd(e: TransitionEvent) {
// when inlineCollapsed menu width animation finished // when inlineCollapsed menu width animation finished
// https://github.com/ant-design/ant-design/issues/12864 // https://github.com/ant-design/ant-design/issues/12864
const widthCollapsed = e.propertyName === 'width' && e.target === e.currentTarget; const widthCollapsed = e.propertyName === 'width' && e.target === e.currentTarget;
// Fix SVGElement e.target.className.indexOf is not a function // Fix SVGElement e.target.className.indexOf is not a function
// https://github.com/ant-design/ant-design/issues/15699 // https://github.com/ant-design/ant-design/issues/15699
const { className } = e.target; const { className } = e.target as (SVGAnimationElement | HTMLElement);
// SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during an animation. // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during an animation.
const classNameValue = const classNameValue =
Object.prototype.toString.call(className) === '[object SVGAnimatedString]' Object.prototype.toString.call(className) === '[object SVGAnimatedString]'