Skip to content

Commit 0be562e

Browse files
committed
fix(compiler-vapor): unset needsQuoting if there is no value
1 parent 58c6486 commit 0be562e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,11 +573,11 @@ describe('compiler: element transform', () => {
573573

574574
test('static props', () => {
575575
const { code, ir } = compileWithElementTransform(
576-
`<div id="foo" class="bar" title="has whitespace" data-targets="foo>bar" />`,
576+
`<div id="foo" class="bar" title="has whitespace" inert data-targets="foo>bar" />`,
577577
)
578578

579579
const template =
580-
'<div id=foo class=bar title="has whitespace"data-targets="foo>bar"></div>'
580+
'<div id=foo class=bar title="has whitespace"inert data-targets="foo>bar"></div>'
581581
expect(code).toMatchSnapshot()
582582
expect(code).contains(JSON.stringify(template))
583583
expect(ir.template).toMatchObject([template])

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ function transformNativeElement(
240240
} else {
241241
template += `=${value}`
242242
}
243+
} else {
244+
needsQuoting = false
243245
}
244246
} else {
245247
dynamicProps.push(key.content)

0 commit comments

Comments
 (0)