-
Notifications
You must be signed in to change notification settings - Fork 33
/
vue2-sfc.html
75 lines (69 loc) · 1.64 KB
/
vue2-sfc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<style>
body {
margin: 0;
}
</style>
<div id="sandbox-demo15"></div>
<script src="https://unpkg.com/mini-sandbox@0.3.18"></script>
<script src="https://unpkg.com/mini-sandbox@0.3.18/dist/vue2-loader.js"></script>
<!-- <script src="./dist/index.umd.js"></script>
<script src="./dist/vue2-loader.js"></script> -->
当前demo的vue引入方式是ES Module
<script type="text/javascript">
new MiniSandbox({
el: '#sandbox-demo15',
files: {
'App.vue': {
urlField: 'code',
defaultValue: `
<template>
<div>
{{ time }}
</div>
</template>
<script>
import moment from 'moment'
export default {
data () {
return {
time: moment().format('YYYY-MM-DD')
}
},
}
<\/script>
<style>
* { color: red }
</style>
`.trim(),
},
},
loaders: {
'.vue': SandboxVue2Loader
},
publicConfig: {
importMap: {
"imports": {
"vue": "https://unpkg.com/vue@2.6.14/dist/vue.esm.browser.min.js",
"moment": "https://esm.sh/moment@2.29.3/moment.js",
"lucky-canvas": "https://unpkg.com/lucky-canvas@1.7.27/dist/index.esm.js",
"vue-search-tree": "https://esm.sh/vue-search-tree@1.9.9/index.js",
},
"scopes": {}
}
},
defaultConfig: {
height: 'calc(100vh - 24px)'
}
})
</script>
</body>
</html>