-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove get children when no dynamic node
- Loading branch information
Showing
5 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
packages/compiler-vapor/__tests__/__snapshots__/compile.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`comile > bindings 1`] = ` | ||
"import { watchEffect } from 'vue' | ||
import { template, setText } from 'vue/vapor' | ||
const t0 = template(\`<div></div>\`) | ||
export function render() { | ||
const root = t0() | ||
watchEffect(() => { | ||
setText(n0, undefined, count.value) | ||
}) | ||
return root | ||
}" | ||
`; | ||
|
||
exports[`comile > static template 1`] = ` | ||
"import { template } from 'vue/vapor' | ||
const t0 = template(\`<div><p>hello</p><input></div>\`) | ||
export function render() { | ||
const root = t0() | ||
return root | ||
}" | ||
`; |
2 changes: 1 addition & 1 deletion
2
..._tests__/__snapshots__/basic.test.ts.snap → ...sts__/__snapshots__/fixtures.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { BindingTypes } from '@vue/compiler-dom' | ||
import { compile } from '../src' | ||
|
||
describe('comile', () => { | ||
it('static template', () => { | ||
const { code } = compile( | ||
`<div> | ||
<p>hello</p> | ||
<input /> | ||
</div>`, | ||
{}, | ||
) | ||
expect(code).matchSnapshot() | ||
}) | ||
|
||
it('bindings', () => { | ||
const { code } = compile(`<div>{{ count }}</div>`, { | ||
bindingMetadata: { | ||
count: BindingTypes.SETUP_REF, | ||
}, | ||
}) | ||
expect(code).matchSnapshot() | ||
}) | ||
}) |
3 changes: 1 addition & 2 deletions
3
...es/compiler-vapor/__tests__/basic.test.ts → ...compiler-vapor/__tests__/fixtures.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters