Skip to content

Commit 452a65c

Browse files
committed
feat(weex): pass stateless component test case
1 parent 62e47c9 commit 452a65c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/platforms/weex/compiler/modules/recycle-list/component-root.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ export function postTransformComponentRoot (
1010
if (!el.parent) {
1111
// component root
1212
addAttr(el, '@isComponentRoot', 'true')
13+
addAttr(el, '@componentProps', JSON.stringify({}))
1314
}
1415
}

test/weex/cases/recycle-list/components/stateless.vdom.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
attr: { templateType: 'A' },
1414
children: [{
1515
type: 'div',
16+
attr: {
17+
'@isComponentRoot': true,
18+
'@componentProps': {}
19+
},
1620
// not supported yet
17-
// attr: {
18-
// '@isComponentRoot': true,
19-
// '@componentProps': {}
20-
// },
2121
// style: {
2222
// height: '120px',
2323
// justifyContent: 'center',

test/weex/helpers/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function omitUseless (object) {
114114
if (isObject(object)) {
115115
delete object.ref
116116
for (const key in object) {
117-
if (isEmptyObject(object[key]) || object[key] === undefined) {
117+
if (key.charAt(0) !== '@' && (isEmptyObject(object[key]) || object[key] === undefined)) {
118118
delete object[key]
119119
}
120120
omitUseless(object[key])

0 commit comments

Comments
 (0)