feat: add switch onswitch-icon and unswitch-icon slot
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
transition: 0.1s linear;
|
||||
}
|
||||
|
||||
.layui-form-switch i {
|
||||
.layui-form-switch span {
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 3px;
|
||||
@@ -43,7 +43,7 @@
|
||||
background-color: @global-checked-color;
|
||||
}
|
||||
|
||||
.layui-form-onswitch i {
|
||||
.layui-form-onswitch span {
|
||||
left: 100%;
|
||||
margin-left: -21px;
|
||||
background-color: #fff;
|
||||
|
||||
@@ -51,7 +51,12 @@ const handleClick = function () {
|
||||
}"
|
||||
>
|
||||
<em>{{ isActive == true ? activeText : inactiveText }}</em>
|
||||
<i></i>
|
||||
<span>
|
||||
<div>
|
||||
<slot v-if="isActive" name="onswitch-icon"></slot>
|
||||
<slot v-else name="unswitch-icon"></slot>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user