三咲智子 Kevin Deng 2 лет назад
Родитель
Сommit
c9beaf6916

+ 1 - 1
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

+ 1 - 1
packages/compiler-vapor/__tests__/__snapshots__/basic.test.ts.snap

@@ -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>'

+ 1 - 0
packages/compiler-vapor/__tests__/fixtures/counter.vue

@@ -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>

+ 1 - 0
playground/src/App.vue

@@ -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>