0.0.2 • Published 14 days ago
@odinlin/astro-preview v0.0.2
Astro Preview
Forked from astro-live-code by Matt Jennings.
Install
npm install @odinlin/astro-preview
import { defineConfig } from 'astro/config'
import preview from '@odinlin/astro-preview'
export default defineConfig({
integrations: [
// ... other integrations
preview({
// layout: './src/MyLayout.astro',
}),
],
})
Useage
<!-- React case -->
<code client:only="react" src="src/components/ReactDemo.tsx" propA="a" style={{ width:'80%' }}>
<span>子节点</span>
</code>
<!-- Vue case -->
<code client:only="vue" src="src/components/VueDemo.vue" propA="a" style="width: 80%">
<span>子节点</span>
</code>