|
|
@@ -1,124 +1,131 @@
|
|
|
// 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>\`)
|
|
|
+"import { watchEffect } from 'vue';
|
|
|
+import { template, children, insert, setText } from 'vue/vapor';
|
|
|
+const t0 = template(\`<div>count is <!>.</div>\`);
|
|
|
export function render() {
|
|
|
-const n0 = t0()
|
|
|
-watchEffect(() => {
|
|
|
-setText(n0, undefined, count.value)
|
|
|
-})
|
|
|
-return n0
|
|
|
-
|
|
|
-}"
|
|
|
+ const n0 = t0();
|
|
|
+ const {
|
|
|
+ 1: [n2],
|
|
|
+ } = children(n0);
|
|
|
+ const n1 = document.createTextNode(count.value);
|
|
|
+ insert(n1, n0, n2);
|
|
|
+ watchEffect(() => {
|
|
|
+ setText(n1, undefined, count.value);
|
|
|
+ });
|
|
|
+ return n0;
|
|
|
+}
|
|
|
+"
|
|
|
`;
|
|
|
|
|
|
exports[`comile > directives > v-bind > simple expression 1`] = `
|
|
|
-"import { watchEffect } from 'vue'
|
|
|
-import { template, setAttr } from 'vue/vapor'
|
|
|
-const t0 = template(\`<div></div>\`)
|
|
|
+"import { watchEffect } from 'vue';
|
|
|
+import { template, setAttr } from 'vue/vapor';
|
|
|
+const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
|
-const n0 = t0()
|
|
|
-watchEffect(() => {
|
|
|
-setAttr(n0, \\"id\\", undefined, id.value)
|
|
|
-})
|
|
|
-return n0
|
|
|
-
|
|
|
-}"
|
|
|
+ const n0 = t0();
|
|
|
+ watchEffect(() => {
|
|
|
+ setAttr(n0, 'id', undefined, id.value);
|
|
|
+ });
|
|
|
+ return n0;
|
|
|
+}
|
|
|
+"
|
|
|
`;
|
|
|
|
|
|
exports[`comile > directives > v-html > no expression 1`] = `
|
|
|
-"import { watchEffect } from 'vue'
|
|
|
-import { template, setHtml } from 'vue/vapor'
|
|
|
-const t0 = template(\`<div></div>\`)
|
|
|
+"import { watchEffect } from 'vue';
|
|
|
+import { template, setHtml } from 'vue/vapor';
|
|
|
+const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
|
-const n0 = t0()
|
|
|
-watchEffect(() => {
|
|
|
-setHtml(n0, undefined, \\"\\")
|
|
|
-})
|
|
|
-return n0
|
|
|
-
|
|
|
-}"
|
|
|
+ const n0 = t0();
|
|
|
+ watchEffect(() => {
|
|
|
+ setHtml(n0, undefined, '');
|
|
|
+ });
|
|
|
+ return n0;
|
|
|
+}
|
|
|
+"
|
|
|
`;
|
|
|
|
|
|
exports[`comile > directives > v-html > simple expression 1`] = `
|
|
|
-"import { watchEffect } from 'vue'
|
|
|
-import { template, setHtml } from 'vue/vapor'
|
|
|
-const t0 = template(\`<div></div>\`)
|
|
|
+"import { watchEffect } from 'vue';
|
|
|
+import { template, setHtml } from 'vue/vapor';
|
|
|
+const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
|
-const n0 = t0()
|
|
|
-watchEffect(() => {
|
|
|
-setHtml(n0, undefined, code.value)
|
|
|
-})
|
|
|
-return n0
|
|
|
-
|
|
|
-}"
|
|
|
+ const n0 = t0();
|
|
|
+ watchEffect(() => {
|
|
|
+ setHtml(n0, undefined, code.value);
|
|
|
+ });
|
|
|
+ return n0;
|
|
|
+}
|
|
|
+"
|
|
|
`;
|
|
|
|
|
|
exports[`comile > directives > v-on > simple expression 1`] = `
|
|
|
-"import { watchEffect } from 'vue'
|
|
|
-import { template, on } from 'vue/vapor'
|
|
|
-const t0 = template(\`<div></div>\`)
|
|
|
+"import { watchEffect } from 'vue';
|
|
|
+import { template, on } from 'vue/vapor';
|
|
|
+const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
|
-const n0 = t0()
|
|
|
-watchEffect(() => {
|
|
|
-on(n0, \\"click\\", handleClick)
|
|
|
-})
|
|
|
-return n0
|
|
|
-
|
|
|
-}"
|
|
|
+ const n0 = t0();
|
|
|
+ watchEffect(() => {
|
|
|
+ on(n0, 'click', handleClick);
|
|
|
+ });
|
|
|
+ return n0;
|
|
|
+}
|
|
|
+"
|
|
|
`;
|
|
|
|
|
|
exports[`comile > directives > v-once 1`] = `
|
|
|
-"import { template, children, insert, setText, setAttr } from 'vue/vapor'
|
|
|
-const t0 = template(\`<div> <span></span></div>\`)
|
|
|
+"import { template, children, insert, setText, setAttr } from 'vue/vapor';
|
|
|
+const t0 = template(\`<div> <span></span></div>\`);
|
|
|
export function render() {
|
|
|
-const n0 = t0()
|
|
|
-const { 1: [n2],} = children(n0)
|
|
|
-const n1 = document.createTextNode(msg.value)
|
|
|
-insert(n1, n0, 0 /* InsertPosition.FIRST */)
|
|
|
-setText(n1, undefined, msg.value)
|
|
|
-setAttr(n2, \\"class\\", undefined, clz.value)
|
|
|
-return n0
|
|
|
-
|
|
|
-}"
|
|
|
+ const n0 = t0();
|
|
|
+ const {
|
|
|
+ 1: [n2],
|
|
|
+ } = children(n0);
|
|
|
+ const n1 = document.createTextNode(msg.value);
|
|
|
+ insert(n1, n0, 0 /* InsertPosition.FIRST */);
|
|
|
+ setText(n1, undefined, msg.value);
|
|
|
+ setAttr(n2, 'class', undefined, clz.value);
|
|
|
+ return n0;
|
|
|
+}
|
|
|
+"
|
|
|
`;
|
|
|
|
|
|
exports[`comile > directives > v-text > no expression 1`] = `
|
|
|
-"import { watchEffect } from 'vue'
|
|
|
-import { template, setText } from 'vue/vapor'
|
|
|
-const t0 = template(\`<div></div>\`)
|
|
|
+"import { watchEffect } from 'vue';
|
|
|
+import { template, setText } from 'vue/vapor';
|
|
|
+const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
|
-const n0 = t0()
|
|
|
-watchEffect(() => {
|
|
|
-setText(n0, undefined, \\"\\")
|
|
|
-})
|
|
|
-return n0
|
|
|
-
|
|
|
-}"
|
|
|
+ const n0 = t0();
|
|
|
+ watchEffect(() => {
|
|
|
+ setText(n0, undefined, '');
|
|
|
+ });
|
|
|
+ return n0;
|
|
|
+}
|
|
|
+"
|
|
|
`;
|
|
|
|
|
|
exports[`comile > directives > v-text > simple expression 1`] = `
|
|
|
-"import { watchEffect } from 'vue'
|
|
|
-import { template, setText } from 'vue/vapor'
|
|
|
-const t0 = template(\`<div></div>\`)
|
|
|
+"import { watchEffect } from 'vue';
|
|
|
+import { template, setText } from 'vue/vapor';
|
|
|
+const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
|
-const n0 = t0()
|
|
|
-watchEffect(() => {
|
|
|
-setText(n0, undefined, str.value)
|
|
|
-})
|
|
|
-return n0
|
|
|
-
|
|
|
-}"
|
|
|
+ const n0 = t0();
|
|
|
+ watchEffect(() => {
|
|
|
+ setText(n0, undefined, str.value);
|
|
|
+ });
|
|
|
+ return n0;
|
|
|
+}
|
|
|
+"
|
|
|
`;
|
|
|
|
|
|
exports[`comile > static template 1`] = `
|
|
|
-"import { template } from 'vue/vapor'
|
|
|
-const t0 = template(\`<div><p>hello</p><input><span></span></div>\`)
|
|
|
+"import { template } from 'vue/vapor';
|
|
|
+const t0 = template(\`<div><p>hello</p><input><span></span></div>\`);
|
|
|
export function render() {
|
|
|
-const n0 = t0()
|
|
|
-return n0
|
|
|
-
|
|
|
-}"
|
|
|
+ const n0 = t0();
|
|
|
+ return n0;
|
|
|
+}
|
|
|
+"
|
|
|
`;
|