]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat: v-pre
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Fri, 24 Nov 2023 07:37:49 +0000 (15:37 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Fri, 24 Nov 2023 07:37:49 +0000 (15:37 +0800)
README.md
packages/compiler-vapor/__tests__/__snapshots__/basic.test.ts.snap
packages/compiler-vapor/__tests__/fixtures/counter.vue
playground/src/App.vue

index adc959e75dc302c0ce80b090c9a573220c267bdd..bb207d5028cb7ca3eb3a21c55896ec297596fb84 100644 (file)
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ See the To-do list below or `// TODO` comments in code (`compiler-vapor` and `ru
   - [x] `v-once`
   - [x] `v-html`
   - [x] `v-text`
-  - [ ] `v-pre`
+  - [x] `v-pre`
   - [ ] `v-cloak`
   - [ ] `v-on` / `v-bind`
     - [x] simple expression
index d0365c84f23e889403c3f6cd79e3b9e3434a9a8f..1a578cd93e1e66002874f29fc7bf0059d888ac9f 100644 (file)
@@ -4,7 +4,7 @@ exports[`basic 1`] = `
 "import { defineComponent as _defineComponent } from 'vue'
 import { watchEffect } from 'vue'
 import { template, insert, setText, on, setHtml } from 'vue/vapor'
-const t0 = template(\`<h1 id=\\"title\\">Counter</h1><p>Count: </p><p>Double: </p><button>Increment</button><div></div><input type=\\"text\\"><p>once: </p>\`)
+const t0 = template(\`<h1 id=\\"title\\">Counter</h1><p>Count: </p><p>Double: </p><button>Increment</button><div></div><input type=\\"text\\"><p>once: </p><p>{{ count }}</p>\`)
 import { ref, computed } from 'vue'
 
 const html = '<b>HTML</b>'
index 17d24cb353094a6cde97fb952268c6d35abfb134..c780b459dec2d80316c4e6c2ba81679242bdbf65 100644 (file)
@@ -17,4 +17,5 @@ const html = '<b>HTML</b>'
   <div v-html="html" />
   <input type="text" />
   <p v-once>once: {{ count }}</p>
+  <p v-pre>{{ count }}</p>
 </template>
index 1abab002cfbab4a0baaeb4b2498876f2c1af5425..df8ef70cb9160a9adb79f45076a0cea7211547fc 100644 (file)
@@ -32,6 +32,7 @@ globalThis.html = html
     <div v-html="html" />
     <div v-text="html" />
     <div v-once>once: {{ count }}</div>
+    <div v-pre>{{ count }}</div>
   </div>
 </template>