wip: test case for v-model + inline mode codegen

This commit is contained in:
Evan You
2020-11-17 15:59:09 -05:00
parent 94736f7729
commit a67325140b
3 changed files with 45 additions and 8 deletions

View File

@@ -121,8 +121,7 @@ const bar = 1
test('avoid unref() when necessary', () => {
// function, const, component import
const { content } = compile(
`
<script setup>
`<script setup>
import { ref, defineOptions } from 'vue'
import Foo from './Foo.vue'
import other from './util'
@@ -151,6 +150,21 @@ const bar = 1
// no need to mark constant fns in patch flag
expect(content).not.toMatch(`PROPS`)
})
test('v-model codegen with unref()', () => {
const { content } = compile(
`<script setup>
import { ref } from 'vue'
const count = ref(0)
</script>
<template>
<input v-model="count">
</template>
`,
{ inlineTemplate: true }
)
assertCode(content)
})
})
describe('with TypeScript', () => {