fix(compiler): stringify values on v-text (#2432)

fix #2430
This commit is contained in:
Eduardo San Martin Morote
2020-10-20 00:12:09 +02:00
committed by GitHub
parent edd49dcab4
commit 314ab2c7c5
3 changed files with 21 additions and 7 deletions

View File

@@ -31,7 +31,9 @@ describe('compiler: v-text transform', () => {
expect((ast.children[0] as PlainElementNode).codegenNode).toMatchObject({
tag: `"div"`,
props: createObjectMatcher({
textContent: `[test]`
textContent: {
arguments: [{ content: 'test' }]
}
}),
children: undefined,
patchFlag: genFlagText(PatchFlags.PROPS),
@@ -50,7 +52,9 @@ describe('compiler: v-text transform', () => {
expect((ast.children[0] as PlainElementNode).codegenNode).toMatchObject({
tag: `"div"`,
props: createObjectMatcher({
textContent: `[test]`
textContent: {
arguments: [{ content: 'test' }]
}
}),
children: undefined, // <-- children should have been removed
patchFlag: genFlagText(PatchFlags.PROPS),