-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_vue.html
More file actions
87 lines (77 loc) · 2.45 KB
/
test_vue.html
File metadata and controls
87 lines (77 loc) · 2.45 KB
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
<!DOCTYPE html>
<html style="width:100%;height:100%;touch-action:none;">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<style>
html {
overflow-y: scroll;
}
body {
padding-bottom: 100px;
}
.mutex-box {
display: block;
position: relative;
margin: 0;
padding: 0;
width: 100%;
min-height: 2000px;
height: auto;
font-size: 0;
}
.mutex-box .mb-item {
position: absolute;
display: inline-block;
background-color: gray;
font-size: 1rem;
transition: all 0.2s;
-webkit-transition: all 0.2s;
/*border: 1px solid white;*/
box-sizing: border-box;
padding: 10px;
/*cursor: pointer;*/
}
@media (max-width:600px) {
.mutex-box .mb-item {
font-size: 0.8rem;
}
}
.mutex-box .mb-item code {
color: palegreen;
white-space: pre-wrap;
}
.mutex-box .dragging {
transition-property: transform;
-webkit-transition-property: -webkit-transform;
transform: scale(1.02);
-webkit-transform: scale(1.02);
box-shadow: 0 0 4px black;
z-index: 10;
/*pointer-events: none;*/
}
</style>
</head>
<body style="margin:0;padding:0;">
<ul class="mutex-box" id="test_vessel">
<li v-for="model of models" class="mb-item" v-bind:class="
{dragging:model.dragging}
" v-bind:style="
{
left:model.left+'px',
top:model.top+'px',
width:model.width+'px',
height:model.height+'px',
...model.style
}
" v-html="model.innerHTML">
</li>
<li style="position: fixed;bottom:10px;width: 100%;z-index: 10000; text-align: center;font-size: 1rem;">
<button @click="mutexBox.trim()"> 纵向压缩 </button>
<button @click="add_models"> 添加一组元素 </button>
<button @click="mutexBox.resize(ncols-1)"> 减少一列 </button>
<button @click="mutexBox.resize(ncols+1)"> 增加一列 </button>
</li>
</ul>
<script async src="./js/test_vue.js"></script>
</body>
</html>