@odinlin/astro-preview

0.0.2 • Public • Published

Astro Preview

Forked from astro-live-code by Matt Jennings.

Install

npm

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>

Readme

Keywords

none

Package Sidebar

Install

npm i @odinlin/astro-preview

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

16.8 kB

Total Files

9

Last publish

Collaborators

  • topazur