Skip to content

Commit

Permalink
docs: add App.vue in demo code
Browse files Browse the repository at this point in the history
  • Loading branch information
hcg1023 committed Oct 30, 2023
1 parent d977ba2 commit 831e411
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -9,6 +9,20 @@ import { normalizePath } from 'vite'
const GIT_MAIN_BRANCH_DOCS_DIR =
'https://github.com/hcg1023/vue3-dnd/tree/main/packages/docs'

const AppVueFileName = `App.vue`
const AppVueFileTemplate = `<template>
<DndProvider :backend="HTML5Backend">
<Container></Container>
</DndProvider>
</template>
<script lang="ts" setup>
import Container from './index.ts'
import { DndProvider } from 'vue3-dnd'
import { HTML5Backend } from 'react-dnd-html5-backend'
</script>`


export const transformDemo = (md: MarkdownIt, srcDir: string) => {
const parser: RuleBlock = (state, startLine, endLine, silent) => {
const CH = '+'.charCodeAt(0)
@@ -81,7 +95,12 @@ export const transformDemo = (md: MarkdownIt, srcDir: string) => {
highlight: highlight(source, type),
},
}
}, {})
}, {} as Record<string, { type: string, raw: string, highlight: string }>)
fileInfos[AppVueFileName] = {
type: 'vue',
raw: AppVueFileTemplate,
highlight: highlight(AppVueFileTemplate, 'vue')
}
const basename = token.info
token.info = ''

0 comments on commit 831e411

Please sign in to comment.