/
githubmirror
/
vuetify
Обзор
Документация
Войти
/
githubmirror
/
vuetify
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/docs/src/components/examples/VueFile.vue
31 строка
512 B
Andrew Henry
docs: auto imports (#19223)
19 фев 2024, 23:22
Не верифицирован
19 фев 2024, 23:22
b177608
Код
Авторство
О чём код?
<template> <component :is="component" v-if="component" /> </template> <script setup> // Utilities import { getExample } from 'virtual:examples' const props = defineProps({ file: { type: String, required: true, }, }) const component = shallowRef() onBeforeMount(load) async function load () { try { const { component: example } = await getExample(props.file) component.value = example } catch (e) { console.error(e) } } </script>