Skip to content

Commit

Permalink
feat(weex): pass stateless component test case
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 19, 2017
1 parent 62e47c9 commit 452a65c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export function postTransformComponentRoot (
if (!el.parent) {
// component root
addAttr(el, '@isComponentRoot', 'true')
addAttr(el, '@componentProps', JSON.stringify({}))
}
}
8 changes: 4 additions & 4 deletions test/weex/cases/recycle-list/components/stateless.vdom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion test/weex/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 452a65c

Please sign in to comment.