fusions-ui 1.2.4 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/fu-avatar/fu-avatar.vue +4 -2
- package/components/fu-avatar/props.js +52 -15
- package/components/fu-avatar-group/fu-avatar-group.vue +3 -2
- package/components/fu-avatar-group/props.js +31 -9
- package/components/fu-badge/fu-badge.vue +8 -14
- package/components/fu-badge/props.js +56 -16
- package/components/fu-banner-arc/fu-banner-arc.vue +4 -5
- package/components/fu-banner-arc/props.js +15 -4
- package/components/fu-button/fu-button.vue +18 -20
- package/components/fu-button/props.js +108 -35
- package/components/fu-cell/fu-cell.vue +9 -8
- package/components/fu-cell-group/fu-cell-group.vue +2 -1
- package/components/fu-cell-group/props.js +7 -2
- package/components/fu-checkbox/fu-checkbox.vue +5 -4
- package/components/fu-checkbox/props.js +51 -14
- package/components/fu-code-input/fu-code-input.vue +10 -6
- package/components/fu-code-input/props.js +66 -17
- package/components/fu-code-verify/fu-code-verify.vue +9 -5
- package/components/fu-code-verify/props.js +64 -17
- package/components/fu-collapse/fu-collapse.vue +10 -3
- package/components/fu-collapse/props.js +9 -3
- package/components/fu-collapse-item/fu-collapse-item.vue +45 -31
- package/components/fu-collapse-item/props.js +49 -16
- package/components/fu-countdown/fu-countdown.vue +2 -1
- package/components/fu-countdown/props.js +15 -4
- package/components/fu-datetime-picker/fu-datetime-picker.vue +6 -5
- package/components/fu-datetime-picker/props.js +91 -25
- package/components/fu-form/fu-form.vue +2 -1
- package/components/fu-form/props.js +34 -6
- package/components/fu-form-item/fu-form-item.vue +26 -33
- package/components/fu-form-item/props.js +30 -8
- package/components/fu-grid/fu-grid.vue +16 -17
- package/components/fu-grid/props.js +20 -5
- package/components/fu-grid-item/fu-grid-item.vue +31 -35
- package/components/fu-grid-item/props.js +11 -3
- package/components/fu-icon/fu-icon.vue +110 -0
- package/components/fu-icon/fuicon.css +584 -0
- package/components/{fu-icons/icons.js → fu-icon/fuicon.js} +1031 -1031
- package/components/{fu-icons/fuicons.ttf → fu-icon/fuicon.ttf} +0 -0
- package/components/fu-icon/props.js +55 -0
- package/components/fu-image/fu-image.vue +15 -10
- package/components/fu-image/props.js +69 -18
- package/components/fu-index-anchor/fu-index-anchor.vue +6 -5
- package/components/fu-index-anchor/props.js +20 -6
- package/components/fu-index-item/fu-index-item.vue +4 -4
- package/components/fu-index-list/fu-index-list.vue +9 -9
- package/components/fu-index-list/props.js +19 -6
- package/components/fu-input/fu-input.vue +54 -68
- package/components/fu-input/props.js +145 -53
- package/components/fu-keyboard/fu-keyboard.vue +19 -9
- package/components/fu-keyboard/keyboard-car.vue +33 -22
- package/components/fu-keyboard/keyboard-number.vue +17 -9
- package/components/fu-keyboard/props.js +66 -17
- package/components/fu-line/fu-line.vue +17 -13
- package/components/fu-line/props.js +30 -5
- package/components/fu-link/fu-link.vue +14 -8
- package/components/fu-link/props.js +22 -7
- package/components/fu-loading/fu-loading.vue +32 -27
- package/components/fu-loading/props.js +28 -8
- package/components/fu-loading-more/fu-loading-more.vue +19 -23
- package/components/fu-loading-more/props.js +27 -13
- package/components/fu-modal/fu-modal.vue +11 -6
- package/components/fu-modal/props.js +61 -17
- package/components/{fu-nav-bar/fu-nav-bar.vue → fu-navbar/fu-navbar.vue} +37 -44
- package/components/fu-notice-bar/fu-notice-bar.vue +10 -8
- package/components/fu-notice-bar/notice-column.vue +187 -122
- package/components/fu-notice-bar/notice-row.vue +85 -28
- package/components/fu-notice-bar/props.js +83 -22
- package/components/fu-number-box/fu-number-box.vue +26 -28
- package/components/fu-number-box/props.js +37 -11
- package/components/fu-parse/fu-parse.vue +0 -1
- package/components/fu-picker/fu-picker.vue +22 -17
- package/components/fu-picker/props.js +70 -19
- package/components/fu-popup/fu-popup.vue +38 -43
- package/components/fu-popup/props.js +34 -9
- package/components/fu-progress/fu-progress.vue +3 -2
- package/components/fu-progress/props.js +36 -9
- package/components/fu-rate/fu-rate.vue +40 -32
- package/components/fu-rate/props.js +47 -13
- package/components/fu-read-more/fu-read-more.vue +19 -14
- package/components/fu-read-more/props.js +68 -46
- package/components/fu-ribbon/fu-ribbon.vue +8 -7
- package/components/fu-ribbon/props.js +15 -4
- package/components/fu-scroll-list/fu-scroll-list.vue +18 -34
- package/components/fu-scroll-list/props.js +19 -10
- package/components/fu-search/fu-search.vue +13 -18
- package/components/fu-search/props.js +69 -17
- package/components/fu-section/fu-section.vue +19 -22
- package/components/fu-section/props.js +30 -4
- package/components/fu-sign-board/fu-sign-board.vue +34 -17
- package/components/fu-sign-board/props.js +15 -5
- package/components/fu-skeleton/fu-skeleton.vue +8 -12
- package/components/fu-skeleton/props.js +15 -4
- package/components/fu-steps/fu-steps.vue +3 -2
- package/components/fu-steps/props.js +23 -7
- package/components/fu-steps-item/fu-steps-item.vue +3 -3
- package/components/fu-steps-item/props.js +15 -5
- package/components/fu-sticky/fu-sticky.vue +3 -3
- package/components/fu-sticky/props.js +21 -7
- package/components/fu-subsection/fu-subsection.vue +29 -22
- package/components/fu-subsection/props.js +40 -10
- package/components/fu-swipe-action-item/bindingx.js +1 -1
- package/components/fu-swipe-action-item/fu-swipe-action-item.vue +134 -123
- package/components/fu-swipe-action-item/mpwxs.js +1 -1
- package/components/fu-swipe-action-item/props.js +22 -6
- package/components/fu-swiper/fu-swiper.vue +29 -27
- package/components/fu-swiper/props.js +81 -25
- package/components/fu-switch/fu-switch.vue +20 -12
- package/components/fu-switch/props.js +48 -13
- package/components/fu-tabs/fu-tabs.vue +36 -33
- package/components/fu-tabs/props.js +46 -13
- package/components/fu-tag/fu-tag.vue +24 -21
- package/components/fu-tag/props.js +63 -17
- package/components/fu-text/fu-text.vue +72 -33
- package/components/fu-text/props.js +85 -27
- package/components/fu-text/value.js +6 -6
- package/components/fu-textarea/fu-textarea.vue +13 -17
- package/components/fu-textarea/props.js +103 -30
- package/components/fu-timeaxis/fu-timeaxis.vue +1 -1
- package/components/fu-timeaxis-item/fu-timeaxis-item.vue +8 -4
- package/components/fu-transition/fu-transition.vue +48 -49
- package/components/fu-transition/props.js +21 -0
- package/components/fu-upload/fu-upload.vue +3 -1
- package/components/fu-upload/props.js +67 -19
- package/components/fu-upload/upload-file.vue +31 -18
- package/components/fu-upload/upload-image.vue +37 -19
- package/components/fu-vtabs/fu-vtabs.vue +6 -4
- package/components/fu-vtabs/props.js +50 -15
- package/components/fu-waterfall/fu-waterfall.vue +11 -9
- package/components/fu-waterfall/props.js +37 -15
- package/index.js +17 -24
- package/index.scss +9 -7
- package/libs/config/config.js +16 -9
- package/libs/function/applyEven.js +9 -9
- package/libs/function/check.js +81 -89
- package/libs/function/{index.js → common.js} +5 -5
- package/libs/function/message.js +0 -27
- package/libs/mixin/mixin.js +26 -21
- package/libs/{utils/min.router.config.js → route/min.route.config.js} +7 -7
- package/libs/{utils/router.config.js → route/route.config.js} +10 -11
- package/libs/{css/main.scss → style/common.scss} +50 -87
- package/libs/style/style.h5.scss +8 -0
- package/libs/style/style.mp.scss +15 -0
- package/package.json +1 -1
- package/components/fu-calendar/calendar-item.vue +0 -214
- package/components/fu-calendar/calendar.js +0 -546
- package/components/fu-calendar/fu-calendar.vue +0 -536
- package/components/fu-calendar/i18n/en.json +0 -12
- package/components/fu-calendar/i18n/index.js +0 -8
- package/components/fu-calendar/i18n/zh-Hans.json +0 -12
- package/components/fu-calendar/i18n/zh-Hant.json +0 -12
- package/components/fu-calendar/util.js +0 -360
- package/components/fu-date-picker/calendar-item.vue +0 -177
- package/components/fu-date-picker/calendar.vue +0 -917
- package/components/fu-date-picker/fu-date-picker.vue +0 -1069
- package/components/fu-date-picker/i18n/en.json +0 -22
- package/components/fu-date-picker/i18n/index.js +0 -8
- package/components/fu-date-picker/i18n/zh-Hans.json +0 -22
- package/components/fu-date-picker/i18n/zh-Hant.json +0 -22
- package/components/fu-date-picker/props.js +0 -68
- package/components/fu-date-picker/time-picker.vue +0 -924
- package/components/fu-date-picker/util.js +0 -419
- package/components/fu-icons/fu-icons.vue +0 -102
- package/components/fu-icons/fuicons.css +0 -585
- package/components/fu-landscape/fu-landscape.vue +0 -167
- package/components/fu-landscape/props.js +0 -64
- package/components/fu-tabbar/fu-tabbar.vue +0 -333
- package/components/fu-tabbar/props.js +0 -78
- package/libs/css/style.h5.scss +0 -35
- package/libs/css/style.mp.scss +0 -50
- package/libs/utils/util.js +0 -58
- /package/components/{fu-nav-bar → fu-navbar}/props.js +0 -0
- /package/components/{fu-nav-bar → fu-navbar}/status-bar.vue +0 -0
- /package/{components/fu-datetime-picker → libs/function}/dayjs.js +0 -0
- /package/libs/{css → style}/color.scss +0 -0
- /package/libs/{css/component.scss → style/components.scss} +0 -0
|
@@ -1,41 +1,63 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 表单校验规则
|
|
5
|
+
* @default null
|
|
6
|
+
*/
|
|
4
7
|
rules: {
|
|
5
8
|
type: Array,
|
|
6
9
|
default () {
|
|
7
|
-
return null
|
|
10
|
+
return null
|
|
8
11
|
}
|
|
9
12
|
},
|
|
10
|
-
|
|
13
|
+
/**
|
|
14
|
+
* @description 表单域的属性名,在使用校验规则时必填
|
|
15
|
+
*/
|
|
11
16
|
prop: {
|
|
12
17
|
type: [String, Array],
|
|
13
18
|
default: ''
|
|
14
19
|
},
|
|
20
|
+
/**
|
|
21
|
+
* @description 是否必填,左边显示红色"*"号
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
15
24
|
required: {
|
|
16
25
|
type: Boolean,
|
|
17
26
|
default: false
|
|
18
27
|
},
|
|
28
|
+
/**
|
|
29
|
+
* @description 输入框左边的文字提示
|
|
30
|
+
*/
|
|
19
31
|
label: {
|
|
20
32
|
type: String,
|
|
21
33
|
default: ''
|
|
22
34
|
},
|
|
23
|
-
|
|
35
|
+
/**
|
|
36
|
+
* @description label的宽度
|
|
37
|
+
*/
|
|
24
38
|
labelWidth: {
|
|
25
39
|
type: [String, Number],
|
|
26
40
|
default: ''
|
|
27
41
|
},
|
|
28
|
-
|
|
42
|
+
/**
|
|
43
|
+
* @description label 居中方式
|
|
44
|
+
* @values 'left' - 左对齐, 'center' - 居中, 'right' - 右对齐
|
|
45
|
+
* @default 'left'
|
|
46
|
+
*/
|
|
29
47
|
labelAlign: {
|
|
30
48
|
type: String,
|
|
31
|
-
default: ''
|
|
49
|
+
default: 'left'
|
|
32
50
|
},
|
|
33
|
-
|
|
51
|
+
/**
|
|
52
|
+
* @description 强制显示错误信息
|
|
53
|
+
*/
|
|
34
54
|
message: {
|
|
35
55
|
type: [String, Boolean],
|
|
36
56
|
default: ''
|
|
37
57
|
},
|
|
38
|
-
|
|
58
|
+
/**
|
|
59
|
+
* @description label的文字的位置,优先级高于fu-form组件中的labelPosition
|
|
60
|
+
*/
|
|
39
61
|
labelPosition: {
|
|
40
62
|
type: String,
|
|
41
63
|
default: ''
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="fu-grid-wrap">
|
|
3
|
-
<view
|
|
3
|
+
<view
|
|
4
|
+
:id="elId"
|
|
5
|
+
ref="fu-grid"
|
|
6
|
+
class="fu-grid"
|
|
7
|
+
:class="{ 'fu-grid--border': showBorder }"
|
|
8
|
+
:style="{ 'border-left-color': borderColor}">
|
|
4
9
|
<slot />
|
|
5
10
|
</view>
|
|
6
11
|
</view>
|
|
@@ -43,17 +48,15 @@
|
|
|
43
48
|
this.children = [];
|
|
44
49
|
},
|
|
45
50
|
mounted() {
|
|
46
|
-
this
|
|
47
|
-
this.init()
|
|
48
|
-
})
|
|
51
|
+
this.init()
|
|
49
52
|
},
|
|
50
53
|
methods: {
|
|
51
54
|
init() {
|
|
52
|
-
|
|
55
|
+
this.$nextTick(() => {
|
|
53
56
|
this.getSize((width) => {
|
|
54
57
|
this.children.forEach(item => item.width = width)
|
|
55
58
|
})
|
|
56
|
-
}
|
|
59
|
+
})
|
|
57
60
|
},
|
|
58
61
|
|
|
59
62
|
change(e) {
|
|
@@ -79,36 +82,32 @@
|
|
|
79
82
|
</script>
|
|
80
83
|
|
|
81
84
|
<style lang="scss" scoped>
|
|
85
|
+
@import '../../libs/style/components.scss';
|
|
86
|
+
$border-color: #D2D2D2;
|
|
87
|
+
|
|
82
88
|
.fu-grid-wrap {
|
|
83
|
-
|
|
84
|
-
display: flex;
|
|
85
|
-
/* #endif */
|
|
89
|
+
@include flex(column);
|
|
86
90
|
flex: 1;
|
|
87
|
-
flex-direction: column;
|
|
88
91
|
/* #ifdef H5 */
|
|
89
92
|
width: 100%;
|
|
90
93
|
/* #endif */
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
.fu-grid {
|
|
94
|
-
|
|
95
|
-
display: flex;
|
|
96
|
-
/* #endif */
|
|
97
|
-
// flex: 1;
|
|
98
|
-
flex-direction: row;
|
|
97
|
+
@include flex(row);
|
|
99
98
|
flex-wrap: wrap;
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
.fu-grid--border {
|
|
103
102
|
position: relative;
|
|
104
103
|
/* #ifdef APP-NVUE */
|
|
105
|
-
border-left-color:
|
|
104
|
+
border-left-color: $border-color;
|
|
106
105
|
border-left-style: solid;
|
|
107
106
|
border-left-width: 0.5px;
|
|
108
107
|
/* #endif */
|
|
109
108
|
/* #ifndef APP-NVUE */
|
|
110
109
|
z-index: 1;
|
|
111
|
-
border-left: 1px
|
|
110
|
+
border-left: 1px solid $border-color;
|
|
112
111
|
/* #endif */
|
|
113
112
|
}
|
|
114
113
|
</style>
|
|
@@ -1,26 +1,41 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 每列显示个数
|
|
5
|
+
* @default 3
|
|
6
|
+
*/
|
|
4
7
|
column: {
|
|
5
8
|
type: [Number],
|
|
6
9
|
default: 3
|
|
7
10
|
},
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @description 是否显示边框
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
9
15
|
showBorder: {
|
|
10
16
|
type: Boolean,
|
|
11
17
|
default: true
|
|
12
18
|
},
|
|
13
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @description 边框颜色
|
|
21
|
+
* @default '#d6d6d6'
|
|
22
|
+
*/
|
|
14
23
|
borderColor: {
|
|
15
24
|
type: String,
|
|
16
25
|
default: '#d6d6d6'
|
|
17
26
|
},
|
|
18
|
-
|
|
27
|
+
/**
|
|
28
|
+
* @description 是否正方形显示
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
19
31
|
square: {
|
|
20
32
|
type: Boolean,
|
|
21
33
|
default: true
|
|
22
34
|
},
|
|
23
|
-
|
|
35
|
+
/**
|
|
36
|
+
* @description 点击背景是否高亮
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
24
39
|
highlight: {
|
|
25
40
|
type: Boolean,
|
|
26
41
|
default: true
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="fu-grid-item" v-if="width" :style="itemStyle">
|
|
3
|
-
<view
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<view
|
|
4
|
+
class="fu-grid-item__box"
|
|
5
|
+
:class="{ 'fu-grid-item--border': showBorder, 'fu-grid-item--border-top': showBorder && index < column, 'fu-highlight': highlight }"
|
|
6
|
+
:style="{'border-right-color': borderColor ,'border-bottom-color': borderColor ,'border-top-color': borderColor }"
|
|
7
|
+
@click="onClick">
|
|
6
8
|
<slot />
|
|
7
9
|
</view>
|
|
8
10
|
</view>
|
|
@@ -33,40 +35,26 @@
|
|
|
33
35
|
showBorder: true,
|
|
34
36
|
square: true,
|
|
35
37
|
highlight: true,
|
|
36
|
-
left: 0,
|
|
37
|
-
top: 0,
|
|
38
38
|
openNum: 2,
|
|
39
|
-
width: 0
|
|
40
|
-
borderColor: '#d6d6d6'
|
|
39
|
+
width: 0
|
|
41
40
|
}
|
|
42
41
|
},
|
|
43
42
|
created() {
|
|
44
|
-
this.column = this.grid.column
|
|
45
|
-
this.showBorder = this.grid.showBorder
|
|
46
|
-
this.square = this.grid.square
|
|
47
|
-
this.highlight = this.grid.highlight
|
|
48
|
-
this.
|
|
49
|
-
this.left = this.ver === 0 ? this.grid.ver : this.ver
|
|
50
|
-
this.borderColor = this.grid.borderColor
|
|
43
|
+
this.column = this.grid.column;
|
|
44
|
+
this.showBorder = this.grid.showBorder;
|
|
45
|
+
this.square = this.grid.square;
|
|
46
|
+
this.highlight = this.grid.highlight;
|
|
47
|
+
this.borderColor = this.grid.borderColor;
|
|
51
48
|
this.grid.children.push(this)
|
|
52
49
|
this.grid.init()
|
|
53
50
|
this.width = this.grid.width
|
|
54
51
|
},
|
|
55
|
-
beforeDestroy() {
|
|
56
|
-
this.grid.children.forEach((item, index) => {
|
|
57
|
-
if (item === this) {
|
|
58
|
-
this.grid.children.splice(index, 1)
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
},
|
|
62
52
|
computed: {
|
|
63
53
|
itemStyle() {
|
|
64
54
|
const style = {
|
|
65
|
-
width: this.width
|
|
55
|
+
width: this.width,
|
|
56
|
+
...(this.square && {height: this.width})
|
|
66
57
|
};
|
|
67
|
-
if(this.square) {
|
|
68
|
-
style.height = this.width;
|
|
69
|
-
}
|
|
70
58
|
return this.$fu.deepMerge(style, this.$fu.addStyle(this.customStyle))
|
|
71
59
|
}
|
|
72
60
|
},
|
|
@@ -78,15 +66,25 @@
|
|
|
78
66
|
}
|
|
79
67
|
})
|
|
80
68
|
}
|
|
69
|
+
},
|
|
70
|
+
beforeDestroy() {
|
|
71
|
+
this.grid.children.forEach((item, index) => {
|
|
72
|
+
if (item === this) {
|
|
73
|
+
this.grid.children.splice(index, 1)
|
|
74
|
+
}
|
|
75
|
+
})
|
|
81
76
|
}
|
|
82
77
|
}
|
|
83
78
|
</script>
|
|
84
79
|
|
|
85
80
|
<style lang="scss" scoped>
|
|
81
|
+
@import '../../libs/style/components.scss';
|
|
82
|
+
$border-color: #D2D2D2;
|
|
83
|
+
|
|
86
84
|
.fu-grid-item {
|
|
85
|
+
@include flex;
|
|
87
86
|
/* #ifndef APP-NVUE */
|
|
88
87
|
height: 100%;
|
|
89
|
-
display: flex;
|
|
90
88
|
/* #endif */
|
|
91
89
|
/* #ifdef H5 */
|
|
92
90
|
cursor: pointer;
|
|
@@ -94,46 +92,44 @@
|
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
.fu-grid-item__box {
|
|
95
|
+
@include flex(column);
|
|
97
96
|
/* #ifndef APP-NVUE */
|
|
98
|
-
display: flex;
|
|
99
97
|
width: 100%;
|
|
100
98
|
/* #endif */
|
|
101
99
|
position: relative;
|
|
102
100
|
flex: 1;
|
|
103
|
-
flex-direction: column;
|
|
104
101
|
}
|
|
105
102
|
|
|
106
103
|
.fu-grid-item--border {
|
|
107
104
|
position: relative;
|
|
108
105
|
/* #ifdef APP-NVUE */
|
|
109
|
-
border-bottom-color:
|
|
106
|
+
border-bottom-color: $border-color;
|
|
110
107
|
border-bottom-style: solid;
|
|
111
108
|
border-bottom-width: 0.5px;
|
|
112
|
-
border-right-color:
|
|
109
|
+
border-right-color: $border-color;
|
|
113
110
|
border-right-style: solid;
|
|
114
111
|
border-right-width: 0.5px;
|
|
115
112
|
/* #endif */
|
|
116
113
|
/* #ifndef APP-NVUE */
|
|
117
114
|
z-index: 0;
|
|
118
|
-
border-bottom: 1px
|
|
119
|
-
border-right: 1px
|
|
115
|
+
border-bottom: 1px solid $border-color;
|
|
116
|
+
border-right: 1px solid $border-color;
|
|
120
117
|
/* #endif */
|
|
121
118
|
}
|
|
122
119
|
|
|
123
120
|
.fu-grid-item--border-top {
|
|
124
121
|
position: relative;
|
|
125
122
|
/* #ifdef APP-NVUE */
|
|
126
|
-
border-top-color:
|
|
123
|
+
border-top-color: $border-color;
|
|
127
124
|
border-top-style: solid;
|
|
128
125
|
border-top-width: 0.5px;
|
|
129
126
|
/* #endif */
|
|
130
127
|
/* #ifndef APP-NVUE */
|
|
131
|
-
border-top: 1px
|
|
128
|
+
border-top: 1px solid $border-color;
|
|
132
129
|
z-index: 0;
|
|
133
130
|
/* #endif */
|
|
134
131
|
}
|
|
135
132
|
|
|
136
|
-
|
|
137
133
|
.fu-highlight:active {
|
|
138
134
|
background-color: #f1f1f1;
|
|
139
135
|
}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @description 是否有点击效果
|
|
5
|
+
* @default true
|
|
6
|
+
*/
|
|
4
7
|
highlight: {
|
|
5
8
|
type: Boolean,
|
|
6
9
|
default: true
|
|
7
10
|
},
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @description 定义背景色
|
|
13
|
+
* @default 'transparent'
|
|
14
|
+
*/
|
|
9
15
|
bgColor: {
|
|
10
16
|
type: String,
|
|
11
17
|
default: 'transparent'
|
|
12
18
|
},
|
|
13
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @description 索引
|
|
21
|
+
*/
|
|
14
22
|
index: {
|
|
15
23
|
type: Number,
|
|
16
24
|
default: 0
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="fu-icon" @click="handleClick">
|
|
3
|
+
<image class="fu-icon__img" :src="name" :mode="imgMode" :style="[imgStyle]" v-if="isImg"></image>
|
|
4
|
+
|
|
5
|
+
<!-- #ifdef APP-NVUE -->
|
|
6
|
+
<text class="fu-icon__icon" :style="iconStyle" v-else>{{ fucode }}</text>
|
|
7
|
+
<!-- #endif -->
|
|
8
|
+
<!-- #ifndef APP-NVUE -->
|
|
9
|
+
<text class="fu-icon__icon" :style="iconStyle" :class="['fu-icon-' + name]" v-else>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</text>
|
|
12
|
+
<!-- #endif -->
|
|
13
|
+
</view>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
18
|
+
import props from './props.js'
|
|
19
|
+
import icon from './fuicon.js'
|
|
20
|
+
// #ifdef APP-NVUE
|
|
21
|
+
var domModule = weex.requireModule('dom');
|
|
22
|
+
import iconUrl from './fuicon.ttf'
|
|
23
|
+
domModule.addRule('fontFace', {
|
|
24
|
+
'fontFamily': "fusionsicon",
|
|
25
|
+
'src': "url('" + iconUrl + "')"
|
|
26
|
+
});
|
|
27
|
+
// #endif
|
|
28
|
+
/**
|
|
29
|
+
* Icon 图标
|
|
30
|
+
* @description 此组件用于展示 icon 图标
|
|
31
|
+
* @property {String} name 图标名称,参考示例
|
|
32
|
+
* @property {String} color 图标颜色
|
|
33
|
+
* @property {Number} size 图标大小(默认 16)
|
|
34
|
+
* @property {String} fontFamily 自定义图标
|
|
35
|
+
* @property {String} imgMode 图片模式,当name为图片地址时生效
|
|
36
|
+
* @property {String,Number} width 显示图片小图标时,图片的宽度
|
|
37
|
+
* @property {String,Number} width 显示图片小图标时,图片的高度
|
|
38
|
+
*
|
|
39
|
+
* @event {Function} click 点击图标触发
|
|
40
|
+
* @example <fu-icon name="success" size="40" color="#ff0000"></fu-icon>
|
|
41
|
+
*/
|
|
42
|
+
export default {
|
|
43
|
+
name:"FuIcon",
|
|
44
|
+
emits:['click'],
|
|
45
|
+
mixins: [mpMixin, props],
|
|
46
|
+
data() {
|
|
47
|
+
return {
|
|
48
|
+
icon: icon.glyphs
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
fucode() {
|
|
53
|
+
let code = this.icon.find(v => v.font_class === this.name)
|
|
54
|
+
if(code){
|
|
55
|
+
return unescape(`%u${code.unicode}`)
|
|
56
|
+
}
|
|
57
|
+
return ''
|
|
58
|
+
},
|
|
59
|
+
iconSize() {
|
|
60
|
+
return this.$fu.addUnit(this.size)
|
|
61
|
+
},
|
|
62
|
+
iconStyle() {
|
|
63
|
+
return {
|
|
64
|
+
color: this.color,
|
|
65
|
+
fontSize: this.iconSize,
|
|
66
|
+
...(this.fontFamily && {fontFamily: this.fontFamily})
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
// 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
|
|
70
|
+
isImg() {
|
|
71
|
+
return this.name.indexOf('/') !== -1
|
|
72
|
+
},
|
|
73
|
+
imgStyle() {
|
|
74
|
+
// 如果设置 width 和 height 属性,则优先使用,否则使用 size 属性
|
|
75
|
+
return {
|
|
76
|
+
width: this.width? this.$fu.addUnit(this.width): this.$fu.addUnit(this.size),
|
|
77
|
+
height: this.height? this.$fu.addUnit(this.height): this.$fu.addUnit(this.size)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
// 图标点击事件
|
|
83
|
+
handleClick() {
|
|
84
|
+
this.$emit('click')
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style lang="scss" scoped>
|
|
91
|
+
@import '../../libs/style/components.scss';
|
|
92
|
+
/* #ifndef APP-NVUE */
|
|
93
|
+
@import './fuicon.css';
|
|
94
|
+
@font-face {
|
|
95
|
+
font-family: fusionsicon;
|
|
96
|
+
src: url('./fuicon.ttf') format('truetype');
|
|
97
|
+
}
|
|
98
|
+
/* #endif */
|
|
99
|
+
|
|
100
|
+
.fu-icon {
|
|
101
|
+
@include flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
|
|
104
|
+
&__icon {
|
|
105
|
+
font-family: fusionsicon;
|
|
106
|
+
text-decoration: none;
|
|
107
|
+
text-align: center;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
</style>
|