Skip to content

Commit af1581b

Browse files
committed
fix(compiler-vapor): v-model argument on native element
1 parent 7548865 commit af1581b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/compiler-vapor/__tests__/transforms/vModel.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ describe('compiler: vModel transform', () => {
9191
)
9292
})
9393

94-
// TODO: component
95-
test.fails('plain elements with argument', () => {
94+
test('plain elements with argument', () => {
9695
const onError = vi.fn()
9796
compileWithVModel('<input v-model:value="model" />', { onError })
9897

packages/compiler-vapor/src/transforms/vModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ export const transformVModel: DirectiveTransform = (dir, node, context) => {
6565
let runtimeDirective: VaporHelper | undefined
6666

6767
if (isComponent) {
68+
} else {
6869
if (dir.arg)
6970
context.options.onError(
7071
createDOMCompilerError(
7172
DOMErrorCodes.X_V_MODEL_ARG_ON_ELEMENT,
7273
dir.arg.loc,
7374
),
7475
)
75-
} else {
7676
const { tag } = node
7777
const isCustomElement = context.options.isCustomElement(tag)
7878
runtimeDirective = 'vModelText'

0 commit comments

Comments
 (0)