-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(weex): WIP adjust component transform stage
- Loading branch information
Showing
4 changed files
with
13 additions
and
11 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
src/platforms/weex/compiler/modules/recycle-list/component-root.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
/* @flow */ | ||
|
||
import { addRawAttr } from 'compiler/helpers' | ||
import { addAttr } from 'compiler/helpers' | ||
|
||
// mark component root nodes as | ||
export function preTransformComponentRoot ( | ||
export function postTransformComponentRoot ( | ||
el: ASTElement, | ||
options: WeexCompilerOptions | ||
) { | ||
if (!el.parent) { | ||
// component root | ||
addRawAttr(el, '$isComponentRoot', true) | ||
addAttr(el, '@isComponentRoot', 'true') | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
src/platforms/weex/compiler/modules/recycle-list/component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
/* @flow */ | ||
|
||
import { addRawAttr } from 'compiler/helpers' | ||
import { addAttr } from 'compiler/helpers' | ||
import { RECYCLE_LIST_MARKER } from 'weex/util/index' | ||
|
||
// mark components as inside recycle-list so that we know we need to invoke | ||
// their special @render function instead of render in create-component.js | ||
export function preTransformComponent ( | ||
export function postTransformComponent ( | ||
el: ASTElement, | ||
options: WeexCompilerOptions | ||
) { | ||
// $flow-disable-line (we know isReservedTag is there) | ||
if (!options.isReservedTag(el.tag) && el.tag !== 'cell-slot') { | ||
addRawAttr(el, RECYCLE_LIST_MARKER, 'true') | ||
addAttr(el, RECYCLE_LIST_MARKER, 'true') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters