+++ /dev/null
-// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-
-exports[`fixtures 1`] = `
-"import { defineComponent as _defineComponent } from 'vue'
-import { template as _template, children as _children, createTextNode as _createTextNode, append as _append, on as _on, setText as _setText, effect as _effect, setHtml as _setHtml } from 'vue/vapor';import { ref, computed } from 'vue'
-
-const html = '<b>HTML</b>'
-
-export default /*#__PURE__*/_defineComponent({
- setup(__props) {
-
-const count = ref(0)
-const double = computed(() => count.value * 2)
-
-const increment = () => count.value++
-
-
-return (() => {
- const t0 = _template("<h1 id=\\"title\\">Counter</h1><p>Count: </p><p>Double: </p><button>Increment</button><div></div><input type=\\"text\\"><p>once: </p><p>{{ count }}</p>")
- const n0 = t0()
- const { 1: [n2], 2: [n4], 3: [n5], 4: [n6], 6: [n8],} = _children(n0)
- const n1 = _createTextNode(count.value)
- _append(n2, n1)
- const n3 = _createTextNode(double.value)
- _append(n4, n3)
- _on(n5, "click", (...args) => (increment && increment(...args)))
- const n7 = _createTextNode(count.value)
- _setText(n7, undefined, count.value)
- _append(n8, n7)
- _effect(() => {
- _setText(n1, undefined, count.value)
- })
- _effect(() => {
- _setText(n3, undefined, double.value)
- })
- _effect(() => {
- _setHtml(n6, undefined, html)
- })
- return n0
-})()
-}
-
-})"
-`;
+++ /dev/null
-import * as CompilerVapor from '../src'
-import { parse, compileScript } from '@vue/compiler-sfc'
-import source from './fixtures/counter.vue?raw'
-
-test('fixtures', async () => {
- const { descriptor } = parse(source, { compiler: CompilerVapor as any })
- const script = compileScript(descriptor, {
- id: 'counter.vue',
- inlineTemplate: true,
- templateOptions: { compiler: CompilerVapor as any },
- })
- expect(script.content).matchSnapshot()
-})
+++ /dev/null
-<script setup lang="ts">
-import { ref, computed } from 'vue'
-
-const count = ref(0)
-const double = computed(() => count.value * 2)
-
-const increment = () => count.value++
-
-const html = '<b>HTML</b>'
-</script>
-
-<template>
- <h1 id="title">Counter</h1>
- <p>Count: {{ count }}</p>
- <p>Double: {{ double }}</p>
- <button @click="increment">Increment</button>
- <div v-html="html" />
- <input type="text" />
- <p v-once>once: {{ count }}</p>
- <p v-pre>{{ count }}</p>
-</template>