fix(mp): 支持 Vue 3.4 v-bind same-name shorthand - #6052
Open
bun-unsafe wants to merge 1 commit into
Open
Conversation
bun-unsafe
force-pushed
the
fix/mp-v-bind-same-name-shorthand
branch
from
September 3, 2026 19:55
c275ed6 to
718426e
Compare
bun-unsafe
force-pushed
the
fix/mp-v-bind-same-name-shorthand
branch
from
September 3, 2026 19:58
718426e to
8a8542e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
:id等价于:id="id"。uni-mp-compiler的transformBind把缺失exp一律当成X_V_BIND_NO_EXPRESSION,产物变成id="{{}}"。@vue/compiler-core@3.4.21的transformBind:空字符串表达式仍报 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)<view :id>,确认 wxml 为id="{{a}}"且 render 含_ctx.id