baidu / san

A fast, portable, flexible JavaScript component framework
https://baidu.github.io/san/
MIT License
4.73k stars 551 forks source link

fix: apack lose parents-child props, issues#553 #554

Closed bugkiwi closed 3 years ago

bugkiwi commented 3 years ago

修复这个问题:https://github.com/baidu/san/issues/553

因为 apack 生成于编译阶段(基于 ast), 所以只处理了当前组件的 template to apack,而在 apack 转成 aNode 时候,缺失了父组件传给子组件的数据,比如 class,style;

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 599048850


Totals Coverage Status
Change from base Build 577738962: 0.003%
Covered Lines: 3080
Relevant Lines: 3107

💛 - Coveralls
bugkiwi commented 3 years ago

错误使用 aNodeUtils.pack入参;

因为aNodeUtils.parseTemplate与 aNodeUtils.parseComponentTemplate区别在 parseComponentTemplate 会『自动抽取第一个子元素作为组件根元素』,相应的 pack 也需要调整。