Skip to content

Commit

Permalink
Fix/compile mode (#15519)
Browse files Browse the repository at this point in the history
* style: lint transform_harmony.rs

* feat: 添加检查子元素单项是否为loop的方法

* feat: 把get_text_component_str中默认的this改为入参

* feat: 所有ets模版支持this由入参决定,去掉text组件的事件添加

* fix: 给getNormalAttributes的入参添加类型断言解决ets类型报错

* feat: 完成初步loop识别

* feat: 修改事件绑定的this

* feat: 添加create_normal_text_template的node_name逻辑

* feat: 添加断言

* feat: 多子结点时其他有一个是循环,不对这个循环进行处理

* feat: 去掉打印

* style: 修改代码缩进为四个空格

* fix: 去掉无用的代码

* feat: 修改文字模版

* feat: 文字相关的工具方法

* feat: 导出getImageMode方法

* feat: rust 模版添加 getImageMode

* feat: 修改 getImageMode 的导出方式

---------

Co-authored-by: mayintao3 <[email protected]>
  • Loading branch information
yoturg and mayintao3 authored Apr 18, 2024
1 parent 730bdd1 commit 8c22833
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion crates/swc_plugin_compile_mode/src/utils/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ pub const HARMONY_IMPORTER: &str = "import {
getNormalAttributes,
shouldBindEvent,
textModify,
setNormalTextAttributeIntoInstance
setNormalTextAttributeIntoInstance,
getImageMode
} from '@tarojs/components'
import {
NodeType,
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_plugin_compile_mode/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ pub fn get_harmony_component_style(visitor: &mut TransformVisitor) -> String {
}
};

build_component(IMAGE_TAG, HARMONY_IMAGE_STYLE_BIND);
// build_component(IMAGE_TAG, HARMONY_IMAGE_STYLE_BIND);
build_component(TEXT_TAG, HARMONY_TEXT_STYLE_BIND);
build_component(TEXT_TAG, HARMONY_TEXT_HELPER_FUNCITON);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TaroImage from './image'
import TaroImage, { getImageMode } from './image'
import TaroText from './text'
import TaroView from './view'
import TaroIcon from './icon'
Expand Down Expand Up @@ -47,7 +47,8 @@ export {
getNodeThresholds,
BUTTON_THEME_COLOR,
getNormalAttributes,
setNormalTextAttributeIntoInstance
setNormalTextAttributeIntoInstance,
getImageMode,
}

export {
Expand Down Expand Up @@ -76,5 +77,5 @@ export {
TaroRadio,
TaroRadioGroup,
TaroCheckboxGroup,
TaroCheckbox
TaroCheckbox,
}

0 comments on commit 8c22833

Please sign in to comment.