-
Notifications
You must be signed in to change notification settings - Fork 33
/
vue-sfc.html
103 lines (98 loc) · 3.06 KB
/
vue-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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!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>
当前demo的vue引入方式是UMD
<div id="sandbox-demo9"></div>
<script src="https://unpkg.com/[email protected]"></script>
<script src="https://unpkg.com/[email protected]/dist/vue-loader.js"></script>
<!-- <script src="./dist/index.umd.js"></script>
<script src="./dist/vue-loader.js"></script> -->
<script type="text/javascript">
new MiniSandbox({
el: '#sandbox-demo9',
files: {
'App.vue': {
urlField: 'code',
defaultValue: `
<template>
<div>
<el-row>
<el-button size="mini" type="primary">按钮一</el-button>
<el-button size="mini" type="success">按钮二</el-button>
<el-button size="mini" type="info">按钮三</el-button>
<el-button size="mini" type="warning">按钮四</el-button>
<el-button size="mini" type="danger">按钮五</el-button>
</el-row>
<el-row>
<el-tag type="primary">标签一</el-tag>
<el-tag type="success">标签二</el-tag>
<el-tag type="info">标签三</el-tag>
<el-tag type="warning">标签四</el-tag>
<el-tag type="danger">标签五</el-tag>
</el-row>
<el-row>
<el-alert title="成功提示的文案" type="success"></el-alert>
<el-alert title="消息提示的文案" type="info"></el-alert>
<el-alert title="警告提示的文案" type="warning"></el-alert>
<el-alert title="错误提示的文案" type="error"></el-alert>
</el-row>
<el-row>
<el-badge :value="12" class="item">
<el-button size="small">评论</el-button>
</el-badge>
<el-badge :value="3" class="item">
<el-button size="small">回复</el-button>
</el-badge>
<el-badge :value="1" class="item" type="primary">
<el-button size="small">评论</el-button>
</el-badge>
<el-badge :value="2" class="item" type="warning">
<el-button size="small">回复</el-button>
</el-badge>
</el-row>
</div>
</template>
<script>
export default {}
<\/script>
<style>
.el-row { margin: 15px 10px; }
.el-row>*:not(button) { margin-right: 15px; }
.el-alert { margin: 10px 0; }
</style>`.trim(),
},
},
loaders: {
'.vue': SandboxVueLoader
},
publicConfig: {
cssLibs: [
'https://unpkg.com/element-ui/lib/theme-chalk/index.css'
],
jsLibs: [
'https://unpkg.com/[email protected]/dist/vue.min.js',
'https://unpkg.com/element-ui/lib/index.js',
// 'https://unpkg.com/@vue/[email protected]/dist/vue-composition-api.prod.js',
// 'https://unpkg.com/[email protected]',
// 'https://unpkg.com/@lucky-canvas/[email protected]',
],
js: `Vue.config.productionTip = false`
},
defaultConfig: {
height: 'calc(100vh - 24px)'
}
})
</script>
</body>
</html>