perf(checkbox): 删除 customChecked 内置逻辑
This commit is contained in:
@@ -4921,6 +4921,10 @@ body .layui-table-tips .layui-layer-content {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.layui-breadcrumb a {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.layui-breadcrumb a:hover {
|
||||
color: #5fb878 !important;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
<template>
|
||||
<span class="layui-breadcrumb" style="visibility: visible">
|
||||
<slot />
|
||||
<slot></slot>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script setup name="LayBreadcrumb" lang="ts">
|
||||
import { defineProps, provide, withDefaults, useSlots } from 'vue'
|
||||
|
||||
const slot = useSlots()
|
||||
const slots = slot.default && slot.default()
|
||||
import { defineProps, provide, withDefaults, useSlots, ref, Ref } from 'vue'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<a href="javascript:void(0)">{{ title }}</a>
|
||||
<span lay-separator="">{{ separator }}</span>
|
||||
<a href>{{ title }}</a>
|
||||
<span lay-separator>{{ separator }}</span>
|
||||
</template>
|
||||
|
||||
<script setup name="LayBreadcrumbItem" lang="ts">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
class="layui-unselect layui-form-checkbox"
|
||||
:class="{
|
||||
'layui-checkbox-disbaled layui-disabled': disabled,
|
||||
'layui-form-checked': needCustomChecked ? customChecked : props.checked,
|
||||
'layui-form-checked': props.checked,
|
||||
}"
|
||||
:lay-skin="skin"
|
||||
>
|
||||
@@ -27,20 +27,12 @@ const props =
|
||||
disabled?: boolean
|
||||
}>()
|
||||
|
||||
const customChecked = ref(false)
|
||||
const needCustomChecked = props.checked == undefined
|
||||
|
||||
const emit = defineEmits(['update:checked', 'change'])
|
||||
|
||||
const handleClick = function () {
|
||||
if (!props.disabled) {
|
||||
if (needCustomChecked) {
|
||||
customChecked.value = !customChecked.value
|
||||
emit('change', !customChecked.value)
|
||||
} else {
|
||||
emit('update:checked', !props.checked)
|
||||
emit('change', !props.checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -20,8 +20,8 @@ const props = withDefaults(
|
||||
defineProps<{
|
||||
modelValue: boolean
|
||||
disabled?: boolean
|
||||
activeText: string
|
||||
inactiveText: string
|
||||
activeText?: string
|
||||
inactiveText?: string
|
||||
}>(),
|
||||
{
|
||||
activeText: '启用',
|
||||
|
||||
Reference in New Issue
Block a user