Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromvuejs/vue

Commit62e47c9

Browse files
committed
feat(weex): WIP adjust component transform stage
1 parent88f3889 commit62e47c9

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*@flow */
22

3-
import{addRawAttr}from'compiler/helpers'
3+
import{addAttr}from'compiler/helpers'
44

55
// mark component root nodes as
6-
exportfunctionpreTransformComponentRoot(
6+
exportfunctionpostTransformComponentRoot(
77
el:ASTElement,
88
options:WeexCompilerOptions
99
){
1010
if(!el.parent){
1111
// component root
12-
addRawAttr(el,'$isComponentRoot',true)
12+
addAttr(el,'@isComponentRoot','true')
1313
}
1414
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*@flow */
22

3-
import{addRawAttr}from'compiler/helpers'
3+
import{addAttr}from'compiler/helpers'
44
import{RECYCLE_LIST_MARKER}from'weex/util/index'
55

66
// mark components as inside recycle-list so that we know we need to invoke
77
// their special@render function instead of render in create-component.js
8-
exportfunctionpreTransformComponent(
8+
exportfunctionpostTransformComponent(
99
el:ASTElement,
1010
options:WeexCompilerOptions
1111
){
1212
// $flow-disable-line (we know isReservedTag is there)
1313
if(!options.isReservedTag(el.tag)&&el.tag!=='cell-slot'){
14-
addRawAttr(el,RECYCLE_LIST_MARKER,'true')
14+
addAttr(el,RECYCLE_LIST_MARKER,'true')
1515
}
1616
}

‎src/platforms/weex/compiler/modules/recycle-list/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*@flow */
22

3-
import{preTransformComponent}from'./component'
4-
import{preTransformComponentRoot}from'./component-root'
3+
import{postTransformComponent}from'./component'
4+
import{postTransformComponentRoot}from'./component-root'
55
import{postTransformText}from'./text'
66
import{preTransformVBind}from'./v-bind'
77
import{preTransformVIf}from'./v-if'
@@ -20,8 +20,6 @@ function preTransformNode (el: ASTElement, options: WeexCompilerOptions) {
2020
currentRecycleList=el
2121
}
2222
if(shouldCompile(el,options)){
23-
preTransformComponent(el,options)
24-
preTransformComponentRoot(el,options)
2523
preTransformVBind(el,options)
2624
preTransformVIf(el,options)// also v-else-if and v-else
2725
preTransformVFor(el,options)
@@ -36,6 +34,10 @@ function transformNode (el: ASTElement, options: WeexCompilerOptions) {
3634

3735
functionpostTransformNode(el:ASTElement,options:WeexCompilerOptions){
3836
if(shouldCompile(el,options)){
37+
// mark child component in parent template
38+
postTransformComponent(el,options)
39+
// mark root in child component template
40+
postTransformComponentRoot(el,options)
3941
// <text>: transform children text into value attr
4042
if(el.tag==='text'){
4143
postTransformText(el,options)

‎src/platforms/weex/util/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ declare var document: Object;
44
import{makeMap}from'shared/util'
55
import{warn}from'core/util/index'
66

7-
exportconstRECYCLE_LIST_MARKER='$inRecycleList'
7+
exportconstRECYCLE_LIST_MARKER='@inRecycleList'
88

99
exportconstisReservedTag=makeMap(
1010
'template,script,style,element,content,slot,link,meta,svg,view,'+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp