diff --git a/components/_util/props-util.js b/components/_util/props-util.js index fe12c72ea..7c5c6b42d 100644 --- a/components/_util/props-util.js +++ b/components/_util/props-util.js @@ -195,15 +195,28 @@ const getAllProps = ele => { if (ele.$) { props = { ...props, ...this.$attrs }; } else { - props = { ...props, ...ele.props }; + props = { ...ele.props, ...props }; } return props; }; // 使用 getOptionProps 替换 ,待测试 -const getPropsData = ele => { - return getOptionProps(ele); - //return ele.props || {}; +const getPropsData = vnode => { + const res = {}; + const originProps = vnode.props || {}; + const props = {}; + Object.keys(originProps).forEach(key => { + props[camelize(key)] = originProps[key]; + }); + const options = vnode.type.props; + Object.keys(options).forEach(k => { + const v = resolvePropValue(options, props, k, props[k]); + if (k in props) { + // 仅包含 props,不包含默认值 + res[k] = v; + } + }); + return res; }; const getValueByProp = (ele, prop) => { return getPropsData(ele)[prop]; diff --git a/components/dropdown/index.js b/components/dropdown/index.js index 69fc43a23..545fdbc66 100644 --- a/components/dropdown/index.js +++ b/components/dropdown/index.js @@ -3,15 +3,13 @@ import DropdownButton from './dropdown-button'; export { DropdownProps } from './dropdown'; export { DropdownButtonProps } from './dropdown-button'; -import Base from '../base'; Dropdown.Button = DropdownButton; /* istanbul ignore next */ -Dropdown.install = function(Vue) { - Vue.use(Base); - Vue.component(Dropdown.name, Dropdown); - Vue.component(DropdownButton.name, DropdownButton); +Dropdown.install = function(app) { + app.component(Dropdown.name, Dropdown); + app.component(DropdownButton.name, DropdownButton); }; export default Dropdown; diff --git a/components/menu/MenuItem.jsx b/components/menu/MenuItem.jsx index 82d770fea..e13edde6b 100644 --- a/components/menu/MenuItem.jsx +++ b/components/menu/MenuItem.jsx @@ -45,13 +45,14 @@ export default { ...tooltipProps, placement: 'right', overlayClassName: `${rootPrefixCls}-inline-collapsed-tooltip`, - children: ( + }; + return ( + + {/* */} {getSlot(this)} - ), - }; - // return
ddd
; - return ; +
+ ); }, }; diff --git a/examples/App.vue b/examples/App.vue index 68b3c48df..83a8f3d14 100644 --- a/examples/App.vue +++ b/examples/App.vue @@ -1,17 +1,18 @@