Skip to content

Commit 22aeaf0

Browse files
committed
feat(render-component): 在renderComponent中添加customDesignProps参数以支持自定义设计属性
1 parent 92c2625 commit 22aeaf0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/vue-common/src/adapter/vue2.7/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@ export const renderComponent = ({
2626
view = null as any,
2727
component = null as any,
2828
props,
29+
customDesignProps,
2930
context: { attrs, listeners: on, slots },
3031
extend = {}
3132
}) => {
3233
return () =>
3334
hooks.h(
3435
(view && view.value) || component,
35-
Object.assign({ props, attrs, [extend.isSvg ? 'nativeOn' : 'on']: on, scopedSlots: { ...slots } }, extend)
36+
Object.assign(
37+
{ props, attrs, customDesignProps, [extend.isSvg ? 'nativeOn' : 'on']: on, scopedSlots: { ...slots } },
38+
extend
39+
)
3640
)
3741
}
3842

packages/vue-common/src/adapter/vue2/index.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,22 @@ export const renderComponent = ({
3434
view = null as any,
3535
component = null as any,
3636
props,
37+
customDesignProps,
3738
context: { attrs, listeners: on, slots },
3839
extend = {}
3940
}) => {
4041
return () =>
4142
hooks.h(
4243
(view && view.value) || component,
4344
Object.assign(
44-
{ props, attrs, [extend.isSvg ? 'nativeOn' : 'on']: on, ref: 'modeTemplate', scopedSlots: { ...slots } },
45+
{
46+
props,
47+
attrs,
48+
customDesignProps,
49+
[extend.isSvg ? 'nativeOn' : 'on']: on,
50+
ref: 'modeTemplate',
51+
scopedSlots: { ...slots }
52+
},
4553
extend
4654
)
4755
)

0 commit comments

Comments
 (0)