@10yun/cv-mobile-ui 0.5.19 → 0.5.21
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/other/mpvue-picker/mpvuePicker.vue +402 -0
- package/{uni-ui/lib → other}/mpvue-picker/style.css +0 -1
- package/{uni-ui/lib → other}/tab-nvue/style.css +0 -1
- package/other/uParse/components/style.css +1 -0
- package/other/uParse/components/wxParseAudio.vue +1 -0
- package/other/uParse/components/wxParseImg.vue +86 -0
- package/other/uParse/components/wxParseTable.vue +54 -0
- package/other/uParse/components/wxParseTemplate0.vue +98 -0
- package/other/uParse/components/wxParseTemplate1.vue +81 -0
- package/other/uParse/components/wxParseTemplate10.vue +81 -0
- package/other/uParse/components/wxParseTemplate11.vue +79 -0
- package/other/uParse/components/wxParseTemplate2.vue +81 -0
- package/other/uParse/components/wxParseTemplate3.vue +81 -0
- package/other/uParse/components/wxParseTemplate4.vue +81 -0
- package/other/uParse/components/wxParseTemplate5.vue +81 -0
- package/other/uParse/components/wxParseTemplate6.vue +81 -0
- package/other/uParse/components/wxParseTemplate7.vue +81 -0
- package/other/uParse/components/wxParseTemplate8.vue +81 -0
- package/other/uParse/components/wxParseTemplate9.vue +81 -0
- package/other/uParse/components/wxParseVideo.vue +14 -0
- package/other/uParse/editor.css +495 -0
- package/{uni-ui/lib/uParse/src → other/uParse}/libs/html2json.js +19 -22
- package/{uni-ui/lib/uParse/src → other/uParse}/libs/htmlparser.js +12 -5
- package/{uni-ui/lib/uParse/src → other/uParse}/libs/wxDiscode.js +2 -2
- package/other/uParse/wxParse.vue +196 -0
- package/package.json +1 -1
- package/plugins/map/amqp-wx.js +173 -0
- package/{uni-ui/lib/mpvueGestureLock/index.vue → ui-cv/components/cv-draw-gesture-lock/cv-draw-gesture-lock.vue} +4 -1
- package/ui-cv/components/cv-draw-gesture-lock/gestureLock.js +169 -0
- package/{uni-ui/lib/mpvueGestureLock → ui-cv/components/cv-draw-gesture-lock}/style.css +0 -1
- package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/style.css +0 -1
- package/ui-cv/components/cv-grid-item/cv-grid-item.vue +1 -1
- package/uni-ui/lib/uni-badge/uni-badge.vue +150 -1
- package/uni-ui/lib/uni-breadcrumb/uni-breadcrumb.vue +37 -1
- package/uni-ui/lib/uni-breadcrumb-item/uni-breadcrumb-item.vue +83 -1
- package/uni-ui/lib/uni-calendar/uni-calendar-item.vue +122 -1
- package/uni-ui/lib/uni-calendar/uni-calendar.vue +366 -1
- package/uni-ui/lib/uni-card/uni-card.vue +124 -1
- package/uni-ui/lib/uni-col/uni-col.vue +1 -1
- package/uni-ui/lib/uni-collapse/uni-collapse.vue +135 -1
- package/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +266 -1
- package/uni-ui/lib/uni-combox/uni-combox.vue +1 -1
- package/uni-ui/lib/uni-countdown/uni-countdown.vue +239 -1
- package/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue +487 -1
- package/uni-ui/lib/uni-data-picker/uni-data-picker.vue +530 -1
- package/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +157 -150
- package/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +166 -1
- package/uni-ui/lib/uni-data-select/uni-data-select.vue +289 -1
- package/uni-ui/lib/uni-datetime-picker/calendar-item.vue +70 -1
- package/uni-ui/lib/uni-datetime-picker/calendar.vue +629 -1
- package/uni-ui/lib/uni-datetime-picker/time-picker.vue +741 -1
- package/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +847 -1
- package/uni-ui/lib/uni-drawer/uni-drawer.vue +115 -1
- package/uni-ui/lib/uni-easyinput/uni-easyinput.vue +515 -1
- package/uni-ui/lib/uni-fab/uni-fab.vue +257 -1
- package/uni-ui/lib/uni-fav/uni-fav.vue +123 -1
- package/uni-ui/lib/uni-file-picker/uni-file-picker.vue +642 -1
- package/uni-ui/lib/uni-file-picker/upload-file.vue +177 -1
- package/uni-ui/lib/uni-file-picker/upload-image.vue +176 -1
- package/uni-ui/lib/uni-forms/uni-forms.vue +375 -1
- package/uni-ui/lib/uni-forms-item/uni-forms-item.vue +429 -1
- package/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +129 -1
- package/uni-ui/lib/uni-grid/uni-grid.vue +115 -1
- package/uni-ui/lib/uni-grid-item/uni-grid-item.vue +78 -1
- package/uni-ui/lib/uni-group/uni-group.vue +85 -1
- package/uni-ui/lib/uni-icons/uni-icons.vue +85 -1
- package/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +68 -1
- package/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +294 -1
- package/uni-ui/lib/uni-list/uni-list.vue +81 -1
- package/uni-ui/lib/uni-list-ad/uni-list-ad.vue +77 -1
- package/uni-ui/lib/uni-list-chat/uni-list-chat.vue +294 -1
- package/uni-ui/lib/uni-list-item/uni-list-item.vue +346 -1
- package/uni-ui/lib/uni-load-more/uni-load-more.vue +172 -1
- package/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue +205 -1
- package/uni-ui/lib/uni-nav-bar/uni-status-bar.vue +18 -1
- package/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +331 -1
- package/uni-ui/lib/uni-number-box/uni-number-box.vue +166 -1
- package/uni-ui/lib/uni-pagination/uni-pagination.vue +323 -1
- package/uni-ui/lib/uni-popup/uni-popup.vue +1 -1
- package/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +173 -1
- package/uni-ui/lib/uni-popup-message/uni-popup-message.vue +74 -1
- package/uni-ui/lib/uni-popup-share/uni-popup-share.vue +106 -1
- package/uni-ui/lib/uni-rate/uni-rate.vue +322 -1
- package/uni-ui/lib/uni-row/uni-row.vue +1 -1
- package/uni-ui/lib/uni-search-bar/uni-search-bar.vue +236 -1
- package/uni-ui/lib/uni-section/uni-section.vue +109 -1
- package/uni-ui/lib/uni-segmented-control/uni-segmented-control.vue +103 -1
- package/uni-ui/lib/uni-status-bar/uni-status-bar.vue +1 -1
- package/uni-ui/lib/uni-steps/uni-steps.vue +120 -1
- package/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +226 -3
- package/uni-ui/lib/uni-swiper-dot/uni-swiper-dot.vue +167 -1
- package/uni-ui/lib/uni-table/uni-table.vue +297 -1
- package/uni-ui/lib/uni-tag/uni-tag.vue +100 -1
- package/uni-ui/lib/uni-td/uni-td.vue +78 -1
- package/uni-ui/lib/uni-th/filter-dropdown.vue +1 -1
- package/uni-ui/lib/uni-th/uni-th.vue +224 -1
- package/uni-ui/lib/uni-thead/uni-thead.vue +77 -1
- package/uni-ui/lib/uni-tr/table-checkbox.vue +79 -1
- package/uni-ui/lib/uni-tr/uni-tr.vue +135 -1
- package/uni-ui/lib/amap-wx/js/util.js +0 -181
- package/uni-ui/lib/marked/index.js +0 -1
- package/uni-ui/lib/mpvue-citypicker/city-data/area.js +0 -12542
- package/uni-ui/lib/mpvue-citypicker/city-data/city.js +0 -1503
- package/uni-ui/lib/mpvue-citypicker/city-data/province.js +0 -139
- package/uni-ui/lib/mpvue-picker/mpvuePicker.vue +0 -3
- package/uni-ui/lib/mpvueGestureLock/gestureLock.js +0 -175
- package/uni-ui/lib/uParse/src/components/style.css +0 -2
- package/uni-ui/lib/uParse/src/components/wxParseAudio.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseImg.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTable.vue +0 -3
- package/uni-ui/lib/uParse/src/components/wxParseTemplate0.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate1.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate10.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate11.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate2.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate3.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate4.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate5.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate6.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate7.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate8.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate9.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseVideo.vue +0 -1
- package/uni-ui/lib/uParse/src/editor.css +0 -495
- package/uni-ui/lib/uParse/src/wxParse.vue +0 -1
- /package/{uni-ui/lib → other}/api-set-tabbar.nvue +0 -0
- /package/{uni-ui/lib → other}/mpvue-echarts/src/echarts.vue +0 -0
- /package/{uni-ui/lib → other}/mpvue-echarts/src/style.css +0 -0
- /package/{uni-ui/lib → other}/mpvue-echarts/src/wx-canvas.js +0 -0
- /package/{uni-ui/lib → other}/product.vue +0 -0
- /package/{uni-ui/lib → other}/style.css +0 -0
- /package/{uni-ui/lib → other}/tab-nvue/mediaList.vue +0 -0
- /package/{uni-ui/lib → other}/u-charts/u-charts.js +0 -0
- /package/{uni-ui/lib/uParse/src → other/uParse}/wxParse.css +0 -0
- /package/{uni-ui/lib/amap-wx → plugins/map}/lib/amap-wx.js +0 -0
- /package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/mpvueCityPicker.vue +0 -0
- /package/{uni-ui/lib/marked → ui-cv/components/cv-markdown-show}/lib/marked.js +0 -0
|
@@ -1 +1,100 @@
|
|
|
1
|
-
<template>
|
|
2
1
|
<text class="uni-tag" v-if="text" :class="classes" :style="customStyle" @click="onClick">{{ text }}</text>
|
|
3
2
|
* Tag 标签
|
|
4
3
|
* @description 用于展示1个或多个文字标签,可点击切换选中、不选中的状态
|
|
5
4
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=35
|
|
6
5
|
* @property {String} text 标签内容
|
|
7
6
|
* @property {String} size = [default|small|mini] 大小尺寸
|
|
8
7
|
* @value default 正常
|
|
9
8
|
* @value small 小尺寸
|
|
10
9
|
* @value mini 迷你尺寸
|
|
11
10
|
* @property {String} type = [default|primary|success|warning|error] 颜色类型
|
|
12
11
|
* @value default 灰色
|
|
13
12
|
* @value primary 蓝色
|
|
14
13
|
* @value success 绿色
|
|
15
14
|
* @value warning 黄色
|
|
16
15
|
* @value error 红色
|
|
17
16
|
* @property {Boolean} disabled = [true|false] 是否为禁用状态
|
|
18
17
|
* @property {Boolean} inverted = [true|false] 是否无需背景颜色(空心标签)
|
|
19
18
|
* @property {Boolean} circle = [true|false] 是否为圆角
|
|
20
19
|
* @event {Function} click 点击 Tag 触发事件
|
|
21
20
|
*/
|
|
22
21
|
name: 'UniTag',
|
|
23
22
|
emits: ['click'],
|
|
24
23
|
props: {
|
|
25
24
|
type: {
|
|
26
25
|
// 标签类型default、primary、success、warning、error、royal
|
|
27
26
|
type: String,
|
|
28
27
|
default: 'default'
|
|
29
28
|
},
|
|
30
29
|
size: {
|
|
31
30
|
// 标签大小 normal, small
|
|
32
31
|
type: String,
|
|
33
32
|
default: 'normal'
|
|
34
33
|
},
|
|
35
34
|
// 标签内容
|
|
36
35
|
text: {
|
|
37
36
|
type: String,
|
|
38
37
|
default: ''
|
|
39
38
|
},
|
|
40
39
|
disabled: {
|
|
41
40
|
// 是否为禁用状态
|
|
42
41
|
type: [Boolean, String],
|
|
43
42
|
default: false
|
|
44
43
|
},
|
|
45
44
|
inverted: {
|
|
46
45
|
// 是否为空心
|
|
47
46
|
type: [Boolean, String],
|
|
48
47
|
default: false
|
|
49
48
|
},
|
|
50
49
|
circle: {
|
|
51
50
|
// 是否为圆角样式
|
|
52
51
|
type: [Boolean, String],
|
|
53
52
|
default: false
|
|
54
53
|
},
|
|
55
54
|
mark: {
|
|
56
55
|
// 是否为标记样式
|
|
57
56
|
type: [Boolean, String],
|
|
58
57
|
default: false
|
|
59
58
|
},
|
|
60
59
|
customStyle: {
|
|
61
60
|
type: String,
|
|
62
61
|
default: ''
|
|
63
62
|
}
|
|
64
63
|
},
|
|
65
64
|
computed: {
|
|
66
65
|
classes() {
|
|
67
66
|
const { type, disabled, inverted, circle, mark, size, isTrue } = this;
|
|
68
67
|
const classArr = [
|
|
69
68
|
'uni-tag--' + type,
|
|
70
69
|
'uni-tag--' + size,
|
|
71
70
|
isTrue(disabled) ? 'uni-tag--disabled' : '',
|
|
72
71
|
isTrue(inverted) ? 'uni-tag--' + type + '--inverted' : '',
|
|
73
72
|
isTrue(circle) ? 'uni-tag--circle' : '',
|
|
74
73
|
isTrue(mark) ? 'uni-tag--mark' : '',
|
|
75
74
|
// type === 'default' ? 'uni-tag--default' : 'uni-tag-text',
|
|
76
75
|
isTrue(inverted) ? 'uni-tag--inverted uni-tag-text--' + type : '',
|
|
77
76
|
size === 'small' ? 'uni-tag-text--small' : ''
|
|
78
77
|
];
|
|
79
78
|
// 返回类的字符串,兼容字节小程序
|
|
80
79
|
return classArr.join(' ');
|
|
81
80
|
}
|
|
82
81
|
},
|
|
83
82
|
methods: {
|
|
84
83
|
isTrue(value) {
|
|
85
84
|
return value === true || value === 'true';
|
|
86
85
|
},
|
|
87
86
|
onClick() {
|
|
88
87
|
if (this.isTrue(this.disabled)) return;
|
|
89
88
|
this.$emit('click');
|
|
90
89
|
}
|
|
91
90
|
}
|
|
91
|
+
<template>
|
|
92
|
+
<text class="uni-tag" v-if="text" :class="classes" :style="customStyle" @click="onClick">{{ text }}</text>
|
|
93
|
+
</template>
|
|
94
|
+
<script>
|
|
95
|
+
/**
|
|
96
|
+
* Tag 标签
|
|
97
|
+
* @description 用于展示1个或多个文字标签,可点击切换选中、不选中的状态
|
|
98
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=35
|
|
99
|
+
* @property {String} text 标签内容
|
|
100
|
+
* @property {String} size = [default|small|mini] 大小尺寸
|
|
101
|
+
* @value default 正常
|
|
102
|
+
* @value small 小尺寸
|
|
103
|
+
* @value mini 迷你尺寸
|
|
104
|
+
* @property {String} type = [default|primary|success|warning|error] 颜色类型
|
|
105
|
+
* @value default 灰色
|
|
106
|
+
* @value primary 蓝色
|
|
107
|
+
* @value success 绿色
|
|
108
|
+
* @value warning 黄色
|
|
109
|
+
* @value error 红色
|
|
110
|
+
* @property {Boolean} disabled = [true|false] 是否为禁用状态
|
|
111
|
+
* @property {Boolean} inverted = [true|false] 是否无需背景颜色(空心标签)
|
|
112
|
+
* @property {Boolean} circle = [true|false] 是否为圆角
|
|
113
|
+
* @event {Function} click 点击 Tag 触发事件
|
|
114
|
+
*/
|
|
115
|
+
export default {
|
|
116
|
+
name: 'UniTag',
|
|
117
|
+
emits: ['click'],
|
|
118
|
+
props: {
|
|
119
|
+
type: {
|
|
120
|
+
// 标签类型default、primary、success、warning、error、royal
|
|
121
|
+
type: String,
|
|
122
|
+
default: 'default'
|
|
123
|
+
},
|
|
124
|
+
size: {
|
|
125
|
+
// 标签大小 normal, small
|
|
126
|
+
type: String,
|
|
127
|
+
default: 'normal'
|
|
128
|
+
},
|
|
129
|
+
// 标签内容
|
|
130
|
+
text: {
|
|
131
|
+
type: String,
|
|
132
|
+
default: ''
|
|
133
|
+
},
|
|
134
|
+
disabled: {
|
|
135
|
+
// 是否为禁用状态
|
|
136
|
+
type: [Boolean, String],
|
|
137
|
+
default: false
|
|
138
|
+
},
|
|
139
|
+
inverted: {
|
|
140
|
+
// 是否为空心
|
|
141
|
+
type: [Boolean, String],
|
|
142
|
+
default: false
|
|
143
|
+
},
|
|
144
|
+
circle: {
|
|
145
|
+
// 是否为圆角样式
|
|
146
|
+
type: [Boolean, String],
|
|
147
|
+
default: false
|
|
148
|
+
},
|
|
149
|
+
mark: {
|
|
150
|
+
// 是否为标记样式
|
|
151
|
+
type: [Boolean, String],
|
|
152
|
+
default: false
|
|
153
|
+
},
|
|
154
|
+
customStyle: {
|
|
155
|
+
type: String,
|
|
156
|
+
default: ''
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
computed: {
|
|
160
|
+
classes() {
|
|
161
|
+
const { type, disabled, inverted, circle, mark, size, isTrue } = this;
|
|
162
|
+
const classArr = [
|
|
163
|
+
'uni-tag--' + type,
|
|
164
|
+
'uni-tag--' + size,
|
|
165
|
+
isTrue(disabled) ? 'uni-tag--disabled' : '',
|
|
166
|
+
isTrue(inverted) ? 'uni-tag--' + type + '--inverted' : '',
|
|
167
|
+
isTrue(circle) ? 'uni-tag--circle' : '',
|
|
168
|
+
isTrue(mark) ? 'uni-tag--mark' : '',
|
|
169
|
+
// type === 'default' ? 'uni-tag--default' : 'uni-tag-text',
|
|
170
|
+
isTrue(inverted) ? 'uni-tag--inverted uni-tag-text--' + type : '',
|
|
171
|
+
size === 'small' ? 'uni-tag-text--small' : ''
|
|
172
|
+
];
|
|
173
|
+
// 返回类的字符串,兼容字节小程序
|
|
174
|
+
return classArr.join(' ');
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
methods: {
|
|
178
|
+
isTrue(value) {
|
|
179
|
+
return value === true || value === 'true';
|
|
180
|
+
},
|
|
181
|
+
onClick() {
|
|
182
|
+
if (this.isTrue(this.disabled)) return;
|
|
183
|
+
this.$emit('click');
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
</script>
|
|
188
|
+
<style>
|
|
189
|
+
@import 'style.css';
|
|
190
|
+
</style>
|
|
@@ -1 +1,78 @@
|
|
|
1
|
-
<template>
|
|
2
1
|
<!-- #ifdef H5 -->
|
|
3
2
|
<td
|
|
4
3
|
class="uni-table-td"
|
|
5
4
|
:rowspan="rowspan"
|
|
6
5
|
:colspan="colspan"
|
|
7
6
|
:class="{ 'table--border': border }"
|
|
8
7
|
:style="{ width: width + 'px', 'text-align': align }"
|
|
9
8
|
>
|
|
10
9
|
<slot></slot>
|
|
11
10
|
</td>
|
|
12
11
|
<!-- #endif -->
|
|
13
12
|
<!-- #ifndef H5 -->
|
|
14
13
|
<!-- :class="{'table--border':border}" -->
|
|
15
14
|
<view class="uni-table-td" :class="{ 'table--border': border }" :style="{ width: width + 'px', 'text-align': align }">
|
|
16
15
|
<slot></slot>
|
|
17
16
|
</view>
|
|
18
17
|
<!-- #endif -->
|
|
19
18
|
* Td 单元格
|
|
20
19
|
* @description 表格中的标准单元格组件
|
|
21
20
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=3270
|
|
22
21
|
* @property {Number} align = [left|center|right] 单元格对齐方式
|
|
23
22
|
*/
|
|
24
23
|
name: 'uniTd',
|
|
25
24
|
options: {
|
|
26
25
|
virtualHost: true
|
|
27
26
|
},
|
|
28
27
|
props: {
|
|
29
28
|
width: {
|
|
30
29
|
type: [String, Number],
|
|
31
30
|
default: ''
|
|
32
31
|
},
|
|
33
32
|
align: {
|
|
34
33
|
type: String,
|
|
35
34
|
default: 'left'
|
|
36
35
|
},
|
|
37
36
|
rowspan: {
|
|
38
37
|
type: [Number, String],
|
|
39
38
|
default: 1
|
|
40
39
|
},
|
|
41
40
|
colspan: {
|
|
42
41
|
type: [Number, String],
|
|
43
42
|
default: 1
|
|
44
43
|
}
|
|
45
44
|
},
|
|
46
45
|
data() {
|
|
47
46
|
return {
|
|
48
47
|
border: false
|
|
49
48
|
};
|
|
50
49
|
},
|
|
51
50
|
created() {
|
|
52
51
|
this.root = this.getTable();
|
|
53
52
|
this.border = this.root.border;
|
|
54
53
|
},
|
|
55
54
|
methods: {
|
|
56
55
|
/**
|
|
57
56
|
* 获取父元素实例
|
|
58
57
|
*/
|
|
59
58
|
getTable() {
|
|
60
59
|
let parent = this.$parent;
|
|
61
60
|
let parentName = parent.$options.name;
|
|
62
61
|
while (parentName !== 'uniTable') {
|
|
63
62
|
parent = parent.$parent;
|
|
64
63
|
if (!parent) return false;
|
|
65
64
|
parentName = parent.$options.name;
|
|
66
65
|
}
|
|
67
66
|
return parent;
|
|
68
67
|
}
|
|
69
68
|
}
|
|
69
|
+
<template>
|
|
70
|
+
<!-- #ifdef H5 -->
|
|
71
|
+
<td
|
|
72
|
+
class="uni-table-td"
|
|
73
|
+
:rowspan="rowspan"
|
|
74
|
+
:colspan="colspan"
|
|
75
|
+
:class="{ 'table--border': border }"
|
|
76
|
+
:style="{ width: width + 'px', 'text-align': align }"
|
|
77
|
+
>
|
|
78
|
+
<slot></slot>
|
|
79
|
+
</td>
|
|
80
|
+
<!-- #endif -->
|
|
81
|
+
<!-- #ifndef H5 -->
|
|
82
|
+
<!-- :class="{'table--border':border}" -->
|
|
83
|
+
<view class="uni-table-td" :class="{ 'table--border': border }" :style="{ width: width + 'px', 'text-align': align }">
|
|
84
|
+
<slot></slot>
|
|
85
|
+
</view>
|
|
86
|
+
<!-- #endif -->
|
|
87
|
+
</template>
|
|
88
|
+
<script>
|
|
89
|
+
/**
|
|
90
|
+
* Td 单元格
|
|
91
|
+
* @description 表格中的标准单元格组件
|
|
92
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=3270
|
|
93
|
+
* @property {Number} align = [left|center|right] 单元格对齐方式
|
|
94
|
+
*/
|
|
95
|
+
export default {
|
|
96
|
+
name: 'uniTd',
|
|
97
|
+
options: {
|
|
98
|
+
virtualHost: true
|
|
99
|
+
},
|
|
100
|
+
props: {
|
|
101
|
+
width: {
|
|
102
|
+
type: [String, Number],
|
|
103
|
+
default: ''
|
|
104
|
+
},
|
|
105
|
+
align: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: 'left'
|
|
108
|
+
},
|
|
109
|
+
rowspan: {
|
|
110
|
+
type: [Number, String],
|
|
111
|
+
default: 1
|
|
112
|
+
},
|
|
113
|
+
colspan: {
|
|
114
|
+
type: [Number, String],
|
|
115
|
+
default: 1
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
data() {
|
|
119
|
+
return {
|
|
120
|
+
border: false
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
created() {
|
|
124
|
+
this.root = this.getTable();
|
|
125
|
+
this.border = this.root.border;
|
|
126
|
+
},
|
|
127
|
+
methods: {
|
|
128
|
+
/**
|
|
129
|
+
* 获取父元素实例
|
|
130
|
+
*/
|
|
131
|
+
getTable() {
|
|
132
|
+
let parent = this.$parent;
|
|
133
|
+
let parentName = parent.$options.name;
|
|
134
|
+
while (parentName !== 'uniTable') {
|
|
135
|
+
parent = parent.$parent;
|
|
136
|
+
if (!parent) return false;
|
|
137
|
+
parentName = parent.$options.name;
|
|
138
|
+
}
|
|
139
|
+
return parent;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
</script>
|
|
144
|
+
<style>
|
|
145
|
+
@import 'style.css';
|
|
146
|
+
</style>
|