@@ -10,5 +10,6 @@ export function postTransformComponentRoot (
if (!el.parent) {
// component root
addAttr(el, '@isComponentRoot', 'true')
+ addAttr(el, '@componentProps', JSON.stringify({}))
}
@@ -13,11 +13,11 @@
attr: { templateType: 'A' },
children: [{
type: 'div',
+ attr: {
+ '@isComponentRoot': true,
+ '@componentProps': {}
+ },
// not supported yet
- // attr: {
- // '@isComponentRoot': true,
- // '@componentProps': {}
- // },
// style: {
// height: '120px',
// justifyContent: 'center',
@@ -114,7 +114,7 @@ function omitUseless (object) {
if (isObject(object)) {
delete object.ref
for (const key in object) {
- if (isEmptyObject(object[key]) || object[key] === undefined) {
+ if (key.charAt(0) !== '@' && (isEmptyObject(object[key]) || object[key] === undefined)) {
delete object[key]
omitUseless(object[key])