-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat dynamic v2 #1486
Feat dynamic v2 #1486
Conversation
Feature/ali support
el.ifConditions.push(condition) | ||
} | ||
|
||
function getAttrExps (attr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个方法没有必要了吧
} | ||
} | ||
|
||
function processShowStyleDynamic (el, show) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把processShowStyle也提出来吧,格式统一一点
@@ -1842,6 +1852,12 @@ function processAliAddComponentRootView (el, options) { | |||
el = postProcessComponentIs(el) | |||
} | |||
|
|||
if (options.runtimeCompile) { | |||
postProcessDynamic(el, config[mode]) | |||
processAttrsDynamic(componentWrapView, config[mode]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用新模式处理吧
vnode.attrsList.splice(i, 1) | ||
} else if (attr.value == null) { | ||
const exp = parseMustacheWithContext('{{ true }}').result | ||
attr.__exps = parseExp(exp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__exps改为__exp吧,现在应该都是单个吧,这里不用parseMustache直接parseExp('true')就可以了吧
} | ||
|
||
function postProcessAttrsDynamic (vnode, config) { | ||
const expsMap = Object.fromEntries(vnode.exps?.map(v => ([v.attrName, v])) || []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exps中的item从设计上讲不一定都有attrName,需要filter一下
const attr = vnode.attrsList[i] | ||
if (config.event.parseEvent(attr.name)) { | ||
// 原本的事件代理直接剔除,主要是基础模版的事件直接走代理形式,事件绑定名直接写死的,优化 astJson 体积 | ||
vnode.attrsList.splice(i, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里也可以直接调用getAndRemoveAttrs来删除
fix: cr change
…ture/merge-master-confict
fix: merge master ali process order
fix: postMoveBaseDirective options
postMoveBaseDirective(componentWrapView, el, options) | ||
|
||
if (options.runtimeCompile) { | ||
processAttrs(componentWrapView, options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processAttrs应该在非runtime情况下也需要跑一遍,放在postMoveBaseDirective前面吧
No description provided.