# 【组件】 卡片模板组件 F
# 描述
左图 + 标题 + 参数
# 使用效果
![voice-template-f-1](/vivo-cards-suits/assets/img/voice-template-f.0b670f2a.png)
# 使用方法
在.ux
文件中引入组件
<import
name="template-f"
src="vivo-cards-suits/components/voice/components/template-f.ux"
></import>
1
2
3
4
2
3
4
# 示例
<template>
<div class="card">
<template-f
title="{{title}}"
params="{{params}}"
img-type="{{imgType}}"
img-url="{{imgUrl}}"
img-resize-mode="{{imgResizeMode}}"
img-object-fit="{{imgObjectFit}}"
></template-f>
</div>
</template>
<script>
export default {
data() {
return {
title: "标题",
params: [
{
key: "参数参数",
value: "参数信息参数信息参数信息参数信息参数信息"
},
{
key: "参数数",
value: "参数信息参数信息参数信息参数信息参数信息"
},
{ key: "参数", value: "参数信息参数信息参数信息参数信息参数信息" }
],
imgType: "A", // A: 144*108 B: 128*128
imgUrl: "",
imgResizeMode: "cover",
imgObjectFit: "cover"
};
}
};
</script>
<style lang="less">
.card {
width: 100%;
flex-direction: column;
}
</style>
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
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
# API
# 组件属性
属性 | 类型 | 默认值 | 说明 |
---|---|---|---|
title | String | - | 标题 |
params | Array | - | 参数数据 |
imgType | String | A | 图片的尺寸类型,A: 144*108 B: 128*128 |
imgUrl | String | - | 图片地址,支持 base64 |
imgResizeMode | String | 'cover' | 图片的缩放类型:cover,contain,stretch,center |
imgObjectFit | String | 'cover' | 图片的缩放类型:contain,cover,fill,none,scale-down |