提交 2c24006d 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

wip(uts): compiler comments

上级 de2353c8
......@@ -12,6 +12,24 @@ describe('compiler:codegen', () => {
`createElementVNode("text", null, toDisplayString(_ctx.msg), 1 /* TEXT */)`
)
})
test('remove comments', () => {
assert(
`<view>
<!-- comment -->
</view>`,
`createElementVNode("view")`
)
assert(
`<view>
<!-- comment1 -->
<text>test</text>
<!-- comment2 -->
</view>`,
`createElementVNode("view", null, [
createElementVNode("text", null, "test")
])`
)
})
test(`function:kotlin`, () => {
assert(
`<view/>`,
......
......@@ -64,6 +64,7 @@ export function compile(
options: CompilerOptions
): CodegenResult {
const ast = baseParse(template, {
comments: false,
isNativeTag(tag) {
return (
isAppUVueNativeTag(tag) ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册