docs: stackblitz not showing code on app.vue

This commit is contained in:
zernonia 2024-03-14 18:46:29 +08:00
parent 72f9bd5ef5
commit 6d0cde4b8e
2 changed files with 3 additions and 6 deletions

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, ref, toRefs, watch } from 'vue'
import { ref, toRefs, watch } from 'vue'
import { Icon } from '@iconify/vue'
import { makeCodeSandboxParams } from '../utils/codeeditor'
import Tooltip from './Tooltip.vue'

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, ref, toRefs, watch } from 'vue'
import { ref, toRefs, watch } from 'vue'
import { Icon } from '@iconify/vue'
import { makeStackblitzParams } from '../utils/codeeditor'
import Tooltip from './Tooltip.vue'
@ -15,12 +15,9 @@ const props = defineProps<{
const { code } = toRefs(props)
const sources = ref<Record<string, string>>({})
onMounted(() => {
})
watch(code, () => {
sources.value['App.vue'] = code.value
})
}, { immediate: true })
function handleClick() {
makeStackblitzParams(props.name, props.style, sources.value)