From: 三咲智子 Kevin Deng Date: Fri, 24 Nov 2023 06:48:51 +0000 (+0800) Subject: feat: v-text X-Git-Tag: v3.6.0-alpha.1~16^2~829 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc3bc7016ec99cb38dce3bf3eb9ef428b79370ae;p=thirdparty%2Fvuejs%2Fcore.git feat: v-text --- diff --git a/README.md b/README.md index 93bfdc129e..f1100c7033 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 8436092c7c..a7bd65e2b1 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 cb0887d99e..5dbfb1f55b 100644 --- a/playground/src/App.vue +++ b/playground/src/App.vue @@ -29,7 +29,8 @@ globalThis.html = html
-
+
+