Skip to content

fix(mp): 支持 Vue 3.4 v-bind same-name shorthand - #6052

Open
bun-unsafe wants to merge 1 commit into
dcloudio:nextfrom
bun-unsafe:fix/mp-v-bind-same-name-shorthand
Open

fix(mp): 支持 Vue 3.4 v-bind same-name shorthand#6052
bun-unsafe wants to merge 1 commit into
dcloudio:nextfrom
bun-unsafe:fix/mp-v-bind-same-name-shorthand

Conversation

@bun-unsafe

@bun-unsafe bun-unsafe commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • Vue 3.4 起 :id 等价于 :id="id"uni-mp-compilertransformBind 把缺失 exp 一律当成 X_V_BIND_NO_EXPRESSION,产物变成 id="{{}}"
  • 对照 @vue/compiler-core@3.4.21transformBind:空字符串表达式仍报 34;无表达式且 arg 静态时填 camelize(arg.content),并走 processExpression
  • v-bind:arg="" 继续报错;<view v-bind />(无 arg)仍是 X_V_BIND_NO_ARGUMENT

Test plan

  • jest packages/uni-mp-compiler/__tests__/vBind.spec.ts — 13 passed(含 same-name shorthand (Vue 3.4):id / v-bind:arg / :foo-bar
  • 用 CLI 建一个 mp-weixin 页面,模板写 <view :id>,确认 wxml 为 id="{{a}}" 且 render 含 _ctx.id

@bun-unsafe
bun-unsafe force-pushed the fix/mp-v-bind-same-name-shorthand branch from c275ed6 to 718426e Compare September 3, 2026 19:55
@bun-unsafe
bun-unsafe force-pushed the fix/mp-v-bind-same-name-shorthand branch from 718426e to 8a8542e Compare September 3, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant