gxd-uni-library-editx 1.0.161 → 1.0.162
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/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view
|
|
3
3
|
class="xd-radio"
|
|
4
|
-
:style="
|
|
4
|
+
:style="[boxWH]"
|
|
5
5
|
@click="handleClick"
|
|
6
6
|
>
|
|
7
7
|
<view
|
|
8
8
|
class="xd-radio__body"
|
|
9
|
-
:style="
|
|
10
|
-
backgroundColor: !disabled?(checked ? uiColor:'#fff'):'#D7D7D7',
|
|
11
|
-
borderColor: !disabled?(checked? uiColor : borderColor):'#D7D7D7',
|
|
12
|
-
}"
|
|
9
|
+
:style="[bodyWH]"
|
|
13
10
|
>
|
|
14
11
|
<view v-if="disabled" class="disabled">
|
|
15
12
|
<xd-font-icon
|
|
@@ -42,10 +39,6 @@
|
|
|
42
39
|
XdFontIcon
|
|
43
40
|
},
|
|
44
41
|
props: {
|
|
45
|
-
size: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: 'default' , //small mini default
|
|
48
|
-
},
|
|
49
42
|
value: {
|
|
50
43
|
type: Boolean,
|
|
51
44
|
default: false
|
|
@@ -66,6 +59,10 @@
|
|
|
66
59
|
type: Number,
|
|
67
60
|
default: 32
|
|
68
61
|
},
|
|
62
|
+
radioSize: {
|
|
63
|
+
type: Number,
|
|
64
|
+
default: 32
|
|
65
|
+
},
|
|
69
66
|
borderColor: {
|
|
70
67
|
type: String,
|
|
71
68
|
default:'#D7D7D7'
|
|
@@ -73,7 +70,11 @@
|
|
|
73
70
|
isClickEvent: {
|
|
74
71
|
type: Boolean,
|
|
75
72
|
default: true
|
|
76
|
-
}
|
|
73
|
+
},
|
|
74
|
+
isOld:{
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: true
|
|
77
|
+
},
|
|
77
78
|
},
|
|
78
79
|
data(){
|
|
79
80
|
return {
|
|
@@ -83,8 +84,42 @@
|
|
|
83
84
|
},
|
|
84
85
|
computed:{
|
|
85
86
|
iconSize(){
|
|
86
|
-
|
|
87
|
+
if(this.isOld) return 26;
|
|
88
|
+
return this.radioSize * 0.625
|
|
87
89
|
},
|
|
90
|
+
boxWH(){
|
|
91
|
+
let width = this.width;
|
|
92
|
+
let height = this.height;
|
|
93
|
+
//兼容老模式
|
|
94
|
+
if(this.isOld){
|
|
95
|
+
width = 68;
|
|
96
|
+
if(height < 68) height = 68;
|
|
97
|
+
}
|
|
98
|
+
if(typeof height === 'string') {
|
|
99
|
+
if(height.indexOf('%') === -1) height = height + 'rpx';
|
|
100
|
+
}
|
|
101
|
+
if(typeof height === 'number') height = height + 'rpx';
|
|
102
|
+
return {
|
|
103
|
+
width: width+ 'rpx',
|
|
104
|
+
height,
|
|
105
|
+
cursor: !this.disabled ? 'pointer':'not-allowed'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
bodyWH(){
|
|
109
|
+
let width = this.radioSize + 'rpx';
|
|
110
|
+
let height = this.radioSize + 'rpx';
|
|
111
|
+
//兼容老模式
|
|
112
|
+
if(this.isOld){
|
|
113
|
+
width = '44rpx';
|
|
114
|
+
height = '44rpx';
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
width,
|
|
118
|
+
height,
|
|
119
|
+
backgroundColor: !this.disabled?(this.checked ? this.uiColor:'#fff'):'#D7D7D7',
|
|
120
|
+
borderColor: !this.disabled?(this.checked? this.uiColor : this.borderColor):'#D7D7D7',
|
|
121
|
+
}
|
|
122
|
+
}
|
|
88
123
|
},
|
|
89
124
|
watch:{
|
|
90
125
|
value(val){
|
|
@@ -138,7 +173,7 @@
|
|
|
138
173
|
justify-content: center;
|
|
139
174
|
align-items: center;
|
|
140
175
|
//#ifdef H5
|
|
141
|
-
margin-top:
|
|
176
|
+
margin-top: 2px!important;
|
|
142
177
|
//#endif
|
|
143
178
|
//#ifdef MP-WEIXIN
|
|
144
179
|
margin-top: 0!important;
|