Skip to content

Commit a8d6487

Browse files
committed
完成按钮基本样式
1 parent 0f901e8 commit a8d6487

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# jam ui - 一个Vue UI框架
2+
3+
## 安装
4+
使用本框架前,请在css中开启 border-box
5+

button.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Vue.component('j-button',{
2+
template: `
3+
<button class="j-button">按钮</button>
4+
`
5+
})

index.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-Hans">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>jam-ui</title>
6+
<style>
7+
*{
8+
margin: 0;
9+
padding: 0;
10+
box-sizing: border-box;
11+
}
12+
:root{
13+
--button-height: 32px;
14+
--font-size: 14px;
15+
--button-bg: white;
16+
--button-active-bg: #eee;
17+
--border-radius: 4px;
18+
--color: #333;
19+
--border-color: #999;
20+
--border-color-hover: #666;
21+
}
22+
#app{
23+
margin: 20px;
24+
}
25+
</style>
26+
<style>
27+
.j-button{
28+
font-size: var(--font-size);
29+
height: var(--button-height);
30+
padding: 0 1em;
31+
border-radius: var(--border-radius);
32+
border: 1px solid var(--border-color);
33+
background: var(--button-bg);
34+
}
35+
.j-button:hover {
36+
border-color: var(--border-color-hover);
37+
}
38+
.j-button:active {
39+
background-color: var(--button-active-bg);
40+
}
41+
.j-button:focus {
42+
outline: none;
43+
}
44+
</style>
45+
</head>
46+
<body>
47+
<div id="app">
48+
<j-button></j-button>
49+
</div>
50+
<script src="./node_modules/vue/dist/vue.min.js"></script>
51+
<script src="./button.js"></script>
52+
<script>
53+
new Vue({
54+
el: '#app',
55+
data:{
56+
jam: 'jam ui'
57+
}
58+
})
59+
</script>
60+
</body>
61+
</html>

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)