We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
wx:if
include
wx:if directive should be able to control an <include> tag, like
<include>
<include wx:if="{{ condition }}" src="path/to/template" />
failing test:
#[test] fn if_on_include() { const SRC: &str = r#"<include wx:if="{{c}}" src="p"/>"#; const GEN: &str = r#"<block wx:if="{{c}}"><include src="p"></include></block>"#; let tree = parse_tmpl(SRC, r#""#).unwrap(); assert_eq!(tree.to_string(), GEN); }
The text was updated successfully, but these errors were encountered:
这里引出一个问题,小程序组件设计初期时,是否考虑过通过使用条件语句来针对<include /> 做按需渲染??文档未做详细阐述。个人理解引用一般用于固定某一处或多处的展示。
<include />
Sorry, something went wrong.
是个 undefined behavior 。目前的实现 <include /> 和 <import /> 是同一个逻辑路径,没有 wx:if 支持的。
<import />
为了与以前的逻辑对齐,这里需要加上 <include /> 的条件和循环控制支持。
fix: wx:if should work on include tag (#118)
a2ea6c7
LastLeaf
No branches or pull requests
wx:if
directive should be able to control an<include>
tag, likefailing test:
The text was updated successfully, but these errors were encountered: