✨(component): update
This commit is contained in:
@@ -45,7 +45,7 @@ const isActive = computed({
|
||||
},
|
||||
});
|
||||
|
||||
const handleClick = function () {
|
||||
const handleClick = () => {
|
||||
if (!props.disabled) {
|
||||
isActive.value = !isActive.value;
|
||||
}
|
||||
@@ -53,9 +53,7 @@ const handleClick = function () {
|
||||
|
||||
const styles = computed(() => {
|
||||
return {
|
||||
"background-color": isActive.value
|
||||
? props.onswitchColor
|
||||
: props.unswitchColor,
|
||||
"background-color": isActive.value ? props.onswitchColor : props.unswitchColor,
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -80,7 +80,6 @@ const slots = slot.default && slot.default();
|
||||
const allChecked = ref(false);
|
||||
const hasChecked = ref(false);
|
||||
const tableDataSource = ref<any[]>([...props.dataSource]);
|
||||
const tableSelectedKeys = ref<Recordable[]>([...props.selectedKeys]);
|
||||
const tableColumns = ref([...props.columns]);
|
||||
const tableColumnKeys = ref(
|
||||
props.columns.map((item: any) => {
|
||||
@@ -90,6 +89,12 @@ const tableColumnKeys = ref(
|
||||
})
|
||||
);
|
||||
|
||||
const tableSelectedKeys = ref<Recordable[]>([...props.selectedKeys]);
|
||||
|
||||
watch(() => props.selectedKeys, () => {
|
||||
tableSelectedKeys.value = props.selectedKeys;
|
||||
},{deep: true})
|
||||
|
||||
const tableSelectedKey: WritableComputedRef<Recordable[]> = computed({
|
||||
get() {
|
||||
return props.selectedKey;
|
||||
|
||||
Reference in New Issue
Block a user