fix: custom icon not support class #351

pull/359/head
tangjinzhou 2018-12-28 12:15:22 +08:00
parent 87ad915520
commit 707e1a44ea
1 changed files with 3 additions and 4 deletions

View File

@ -26,8 +26,9 @@ export default function create (options) {
const Iconfont = {
functional: true,
name: 'AIconfont',
props: Icon.props,
render (h, context) {
const { props, slots, listeners } = context
const { props, slots, listeners, data } = context
const { type, ...restProps } = props
const slotsMap = slots()
const children = slotsMap.default
@ -40,9 +41,7 @@ export default function create (options) {
content = children
}
return (
<Icon
{...{ props: restProps, on: listeners }}
>
<Icon {...{ ...data, props: restProps, on: listeners }}>
{content}
</Icon>