diff --git a/README.md b/README.md index 93bfdc129..f1100c703 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ See the To-do list below or `// TODO` comments in code (`compiler-vapor` and `ru - [ ] `v-for` - [ ] `v-once` - [x] `v-html` - - [ ] `v-text` + - [x] `v-text` - [ ] `v-show` - [ ] `v-pre` - [ ] `v-cloak` diff --git a/packages/compiler-vapor/src/transform.ts b/packages/compiler-vapor/src/transform.ts index 8436092c7..a7bd65e2b 100644 --- a/packages/compiler-vapor/src/transform.ts +++ b/packages/compiler-vapor/src/transform.ts @@ -216,6 +216,7 @@ function transformElement(ctx: TransformContext) { if (children.length) transformChildren(ctx) // TODO remove unnecessary close tag + // TODO: [bug] self closing
if (!node.isSelfClosing) ctx.template += `` } @@ -354,6 +355,13 @@ function transformProp( element: ctx.getElementId(), }) break + case 'text': + ctx.registerEffect(expr, { + type: IRNodeTypes.SET_TEXT, + loc: node.loc, + element: ctx.getElementId(), + }) + break } } diff --git a/playground/src/App.vue b/playground/src/App.vue index cb0887d99..5dbfb1f55 100644 --- a/playground/src/App.vue +++ b/playground/src/App.vue @@ -29,7 +29,8 @@ globalThis.html = html
-
+
+