wip: support inherit-attrs="false" on sfc <tempalte>

This commit is contained in:
Evan You
2020-11-24 15:28:35 -05:00
parent 47d73c23e1
commit faed98972c
4 changed files with 75 additions and 26 deletions

View File

@@ -70,6 +70,28 @@ const myEmit = defineEmit(['foo', 'bar'])
emits: ['foo', 'bar'],`)
})
test('<template inherit-attrs="false">', () => {
const { content } = compile(`
<script>
export default {}
</script>
<template inherit-attrs="false">
{{ a }}
</template>
`)
assertCode(content)
const { content: content2 } = compile(`
<script setup>
const a = 1
</script>
<template inherit-attrs="false">
{{ a }}
</template>
`)
assertCode(content2)
})
describe('<script> and <script setup> co-usage', () => {
test('script first', () => {
const { content } = compile(`