CSS 技巧

Flexbox

Properties for the Parent

1
2
3
4
5
6
7
8
.container {
display: flex;
flex-direction: row | row-reverse | column | column-reverse;
flex-wrap: nowrap | wrap | wrap-reverse;
justify-content: flex-start | flex-end | center | space-between | space-around | space-evenly | start | end | left | right ... + safe | unsafe;
align-items: stretch | flex-start | flex-end | center | baseline | first baseline | last baseline | start | end | self-start | self-end + ... safe | unsafe;
align-content: flex-start | flex-end | center | space-between | space-around | space-evenly | stretch | start | end | baseline | first baseline | last baseline + ... safe | unsafe;
}

flex-flow is a shorthand for the flex-direction and flex-wrap properties, which together define the flex container’s main and cross axes. The default value is row nowrap.

Properties for the Children

1
2
3
4
5
6
7
.item {
order: 5; /* default is 0 */
flex-grow: 4; /* default 0 */
flex-shrink: 3; /* default 1 */
flex-basis: | auto; /* default auto */
align-self: auto | flex-start | flex-end | center | baseline | stretch;
}

flex is the shorthand for flex-grow, flex-shrink and flex-basis combined. The second and third parameters (flex-shrink and flex-basis) are optional. The default is 0 1 auto, but if you set it with a single number value, it’s like 1 0.

Truncate String with Ellipsis

1
2
3
4
5
6
7
8
9
10
11
12
13
14
.truncate {
width: 250px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.ellipsis-on-second-line {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}

在表格中的单元格

1
2
3
4
5
6
7
8
9
10
table {
table-layout: fixed;
}

td {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: inline-block;
}

参考

圆角

https://www.zhangxinxu.com/wordpress/2015/11/css3-border-radius-tips/

box-shadow

1
2
3
4
5
6
7
8
/* offset-x | offset-y | color */
box-shadow: 60px -16px teal;

/* offset-x | offset-y | blur-radius | color */
box-shadow: 10px 5px 5px black;

/* offset-x | offset-y | blur-radius | spread-radius | color */
box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2);

政治面貌列表

代码 全称
01 中国共产党党员
02 中国共产党预备党员
03 中国共产主义青年团团员
04 中国国民党革命委员会会员
05 中国民主同盟盟员
06 中国民主建国会会员
07 中国民主促进会会员
08 中国农工民主党党员
09 中国致公党党员
10 九三学社社员
11 台湾民主自治同盟盟员
12 无党派民主人士
13 群众

GB/T 4762-1984
GB/T 4762-1984 - 图片

民族列表

代码 全称
01 汉族
02 蒙古族
03 回族
04 藏族
05 维吾尔族
06 苗族
07 彝族
08 壮族
09 布依族
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 基诺族
97 其他
98 外国血统中国籍人士

GB/T 3304-1991
GB/T 3304-1991 (image)

使用 Vue.js

Vue is a progressive framework for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects.

History

版本 时间
1.0 2015-10
2.0 2016-08
2.1 2016-11
2.2 2017-02
2.3 2017-04
2.4 2017-07
2.5 2017-10
2.6 2019-02
3.0 2020-09
3.1 2021-06

Guide

Vue 2 Guide
Vue 2 中文教程
Vue 3 Guide

Lifecycle

beforeCreate
created
beforeMount
mounted
beforeUpdate
updated
beforeDestroy
destroyed

Lifecycle Diagram

注意

  • data定义的数据项的数据类型必须和真实数据类型一致

参考

我的Vue示例