Browse Source

修改switch组件文案显示不正确

pull/72/head
zq 4 days ago
parent
commit
0875b26b52
  1. 14
      src/components/GuipSwitch.vue

14
src/components/GuipSwitch.vue

@ -1,11 +1,13 @@
<template>
<el-form-item>
<div class="switchWrap">
<span :class="['switchDesc',{'fl':float =='left'},{'fr':float =='right'}]" v-if="activeText || inactiveText">{{ internalValue ? activeText : inactiveText
<span :class="['switchDesc',{'fl':float =='left'},{'fr':float =='right'}]" v-if="activeText || inactiveText">
{{ internalValue === activeValue ? activeText : inactiveText
}}</span>
<el-switch v-model="internalValue" :active-color="activeColor" :inactive-color="inactiveColor" v-bind="$attrs"
:disabled="disabled || loading" @change="handleChange">
:disabled="disabled || loading" :active-value="activeValue"
:inactive-value="inactiveValue" @change="handleChange">
<!-- 自定义开启时的图标 -->
<template #active-icon>
</template>
@ -39,6 +41,14 @@ export default {
type: [Boolean,String,Number],
default: false,
},
activeValue: {
type: [Boolean,String,Number],
default: '',
},
inactiveValue: {
type: [Boolean,String,Number],
default: '',
},
activeColor: {
type: String,
default: '#00C261',

Loading…
Cancel
Save