import { loading } from 'dls-graphics' const API_CSB = 'https://codesandbox.io/api/v1/sandboxes/define' export function createCodeSandbox (sfc) { const win = window.open() win.document.write(landing) fetch(`${API_CSB}?json=1`, { method: 'POST', headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, body: JSON.stringify({ files: { ...templateFiles, 'src/Demo.vue': { content: sfc } } }) }) .then(res => res.json()) .then(data => { win.location = `https://codesandbox.io/s/${data.sandbox_id}?file=/src/Demo.vue` }) } const meta = `{ "dependencies": { "veui": "2.1.2", "veui-theme-dls": "2.1.2", "vue": "2.6.14" } } ` const prettier = `{ "printWidth": 80, "tabWidth": 2, "useTabs": false, "semi": false, "singleQuote": true, "trailingComma": "none", "bracketSpacing": true, "jsxBracketSameLine": false, "fluid": false } ` const index = `