@@ -13,8 +13,13 @@ A Vite plugin made for previewing and editing Vue components in Markdown and, of
1313
1414<!-- #region demo -->
1515``` vue preview
16+ <script lang="ts" setup>
17+ import { isSpecialBooleanAttr } from '@vue/shared'
18+ </script>
19+
1620<template>
1721 <h1>Demo: vite-plugin-vue-preview</h1>
22+ <span>readonly is special boolean attr: {{ isSpecialBooleanAttr('readonly') }}</span>
1823</template>
1924```
2025<!-- #endregion demo -->
@@ -49,6 +54,8 @@ interface Props {
4954 previewBodyStyle: Partial <CSSStyleDeclaration > | string
5055 // Styling of the root component in the iframe element
5156 previewAppStyle? : Partial <CSSStyleDeclaration > | string
57+ // Third-party dependencies (CDN) that can be introduced by the demo component
58+ importMap? : Record <string , string > | string
5259}
5360```
5461
@@ -78,7 +85,7 @@ interface Props {
7885```TS
7986import { createApp } from 'vue'
8087import { VuePreview } from 'vite-plugin-vue-preview '
81- import 'vite-plugin-vue-preview /dist/ style .css'
88+ import 'vite-plugin-vue-preview /style .css'
8289
8390const app = createApp()
8491
@@ -102,7 +109,7 @@ export default defineConfig({
102109// .vitepress/theme/index.ts
103110import DefaultTheme from ' vitepress/theme'
104111import { VuePreview } from ' vite-plugin-vue-preview'
105- import ' vite-plugin-vue-preview/dist/ style.css'
112+ import ' vite-plugin-vue-preview/style.css'
106113
107114export default {
108115 ... DefaultTheme ,
@@ -140,6 +147,9 @@ export default defineConfig({
140147 alignItems: ' center' ,
141148 flexDirection: ' column' ,
142149 },
150+ importMap: {
151+ ' @vue/shared' : ' https://unpkg.com/@vue/shared@latest/dist/shared.esm-bundler.js' ,
152+ },
143153 },
144154 })],
145155})
0 commit comments