|
@@ -20,7 +20,7 @@
|
|
|
:size="selectStyleType(size, 'medium', FonstSizes)"
|
|
:size="selectStyleType(size, 'medium', FonstSizes)"
|
|
|
:color="themeContext.resolveThemeColor(loadingColor) || currentStyle.color"
|
|
:color="themeContext.resolveThemeColor(loadingColor) || currentStyle.color"
|
|
|
:innerStyle="{
|
|
:innerStyle="{
|
|
|
- marginRight: currentText ? '10rpx': undefined,
|
|
|
|
|
|
|
+ marginRight: iconMargin ? '10rpx': undefined,
|
|
|
}"
|
|
}"
|
|
|
/>
|
|
/>
|
|
|
<Icon
|
|
<Icon
|
|
@@ -29,7 +29,7 @@
|
|
|
:size="selectStyleType(size, 'medium', FonstSizes)"
|
|
:size="selectStyleType(size, 'medium', FonstSizes)"
|
|
|
:color="currentStyle.color"
|
|
:color="currentStyle.color"
|
|
|
:innerStyle="{
|
|
:innerStyle="{
|
|
|
- marginRight: currentText ? '10rpx': undefined,
|
|
|
|
|
|
|
+ marginRight: iconMargin ? '10rpx': undefined,
|
|
|
}"
|
|
}"
|
|
|
v-bind="iconProps"
|
|
v-bind="iconProps"
|
|
|
/>
|
|
/>
|
|
@@ -50,7 +50,7 @@
|
|
|
:size="selectStyleType(size, 'medium', FonstSizes)"
|
|
:size="selectStyleType(size, 'medium', FonstSizes)"
|
|
|
:color="currentStyle.color"
|
|
:color="currentStyle.color"
|
|
|
:innerStyle="{
|
|
:innerStyle="{
|
|
|
- marginLeft: currentText ? '10rpx' : undefined,
|
|
|
|
|
|
|
+ marginLeft: iconMargin ? '10rpx' : undefined,
|
|
|
}"
|
|
}"
|
|
|
v-bind="rightIconProps"
|
|
v-bind="rightIconProps"
|
|
|
/>
|
|
/>
|
|
@@ -365,7 +365,8 @@ const currentStyle = computed(() => {
|
|
|
|
|
|
|
|
const state = ref('');
|
|
const state = ref('');
|
|
|
|
|
|
|
|
-const currentText = computed(() => props.loading ? (props.loadingText || props.text) : props.text);
|
|
|
|
|
|
|
+const currentText = computed(() => (props.loading ? (props.loadingText || props.text) : props.text));
|
|
|
|
|
+const iconMargin = computed(() => Boolean(currentText.value));
|
|
|
const textColorFinal = computed(() => (
|
|
const textColorFinal = computed(() => (
|
|
|
state.value === 'active' ?
|
|
state.value === 'active' ?
|
|
|
themeContext.resolveThemeColor(props.pressedTextColor) :
|
|
themeContext.resolveThemeColor(props.pressedTextColor) :
|