-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
105 lines (97 loc) · 2.51 KB
/
index.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
104
105
<!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>utils</title>
<script src="https://cdn.bootcss.com/vue/2.5.16/vue.js"></script>
<!-- 引入样式 -->
<link href="https://cdn.bootcss.com/element-ui/2.4.0/theme-chalk/index.css" rel="stylesheet">
<!-- 引入组件库 -->
<script src="https://cdn.bootcss.com/element-ui/2.4.0/index.js"></script>
<style>
.string {
color: #b24b36;
}
#arrow_str{
width: 160px;
height: 100px;
text-align: center;
line-height: 30px;
margin: 10px auto;
box-shadow: 0 0px 10px 0 #ccc;
}
</style>
</head>
<body>
<div id="app">
<el-row>
<el-col :span="24">
<el-collapse v-model="activeName" accordion>
<el-collapse-item title="client.js 客户端检测" name="1">
<div class="string">"UA": {{ua}}</div>
<div>{{client}}</div>
</el-collapse-item>
<el-collapse-item title="emoji.js" name="2">
<el-autocomplete class="inline-input" v-model="state2" :fetch-suggestions="querySearch" placeholder="请输入emoji名字" :trigger-on-focus="true" @select="handleSelect">
<i class="el-icon-edit el-input__icon" slot="suffix">
</i>
<template slot-scope="{ item }">
{{item.name}}
<span style="float: right;">{{item.value}}</span>
</template>
</el-autocomplete>
</el-collapse-item>
<el-collapse-item title="rotate.js" name="3">
<div id="arrow_str">
alpha<br>beta<br>gamma
</div>
</el-collapse-item>
</el-collapse>
</el-col>
</el-row>
</div>
</body>
<script src="client.js"></script>
<script src="emoji.js"></script>
<script src="iphone.js"></script>
<script>
new Vue({
el: '#app',
data() {
return {
ua: navigator.userAgent,
client: client().toString(),
activeName: "3",
state2: '',
emoji_array: [],
}
},
computed: {
},
methods: {
handleSelect(item) {
console.log(item);
//this.state2 = item.real_value;
},
querySearch(queryString, cb) {
var results = queryString ? this.emoji_array.filter((x) => x.name.toLowerCase().indexOf(queryString.toLowerCase()) > -1) : this.emoji_array;
// 调用 callback 返回建议列表的数据
cb(results);
}
},
watch:{
},
mounted() {
for (var i in emoji) {
this.emoji_array.push({
"name": i,
"value": emoji[i]
});
}
console.log(this.emoji_array[0], this.emoji_array[100])
}
});
</script>
</html>