mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-11-27 04:09:51 +08:00
site: fix demo with script not working in codesandbox
This commit is contained in:
parent
48e47f4649
commit
c0ba6ec088
@ -16,6 +16,29 @@ const indexHtml = `<!DOCTYPE html>
|
||||
</html>
|
||||
`
|
||||
|
||||
const appVue = `<template>
|
||||
<n-loading-bar-provider>
|
||||
<n-message-provider>
|
||||
<n-notification-provider>
|
||||
<n-dialog-provider>
|
||||
<demo />
|
||||
</n-dialog-provider>
|
||||
</n-notification-provider>
|
||||
</n-message-provider>
|
||||
</n-loading-bar-provider>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defineComponent } from "vue";
|
||||
import Demo from "./Demo.vue";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
Demo,
|
||||
},
|
||||
});
|
||||
</script>`
|
||||
|
||||
const mainJs = `import { createApp } from "vue";
|
||||
import naive from "naive-ui";
|
||||
import App from "./App.vue";
|
||||
@ -35,15 +58,21 @@ export function getCodeSandboxParams (code) {
|
||||
dependencies: {
|
||||
vue: 'next',
|
||||
'naive-ui': 'latest'
|
||||
},
|
||||
devDependencies: {
|
||||
'@vue/cli-plugin-babel': '~4.5.0'
|
||||
}
|
||||
}
|
||||
},
|
||||
'index.html': {
|
||||
content: indexHtml
|
||||
},
|
||||
'src/App.vue': {
|
||||
'src/Demo.vue': {
|
||||
content: code
|
||||
},
|
||||
'src/App.vue': {
|
||||
content: appVue
|
||||
},
|
||||
'src/main.js': {
|
||||
content: mainJs
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user