fix(compiler-dom): properly stringify v-html/v-text with constant value
fix #5439 close #5445
This commit is contained in:
@@ -433,4 +433,25 @@ describe('stringify static html', () => {
|
||||
]
|
||||
})
|
||||
})
|
||||
|
||||
// #5439
|
||||
test('stringify v-html', () => {
|
||||
const { code } = compileWithStringify(`
|
||||
<pre data-type="js"><code v-html="'<span>show-it </span>'"></code></pre>
|
||||
<div class>
|
||||
<span class>1</span><span class>2</span>
|
||||
</div>`)
|
||||
expect(code).toMatch(`<code><span>show-it </span></code>`)
|
||||
expect(code).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('stringify v-text', () => {
|
||||
const { code } = compileWithStringify(`
|
||||
<pre data-type="js"><code v-text="'<span>show-it </span>'"></code></pre>
|
||||
<div class>
|
||||
<span class>1</span><span class>2</span>
|
||||
</div>`)
|
||||
expect(code).toMatch(`<code><span>show-it </span></code>`)
|
||||
expect(code).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user