This commit is contained in:
神仙都没用 2024-04-22 10:46:57 +08:00
parent 1e1296d14d
commit 5a51d07c6d
2 changed files with 20 additions and 3 deletions

View File

@ -97,7 +97,7 @@
import { useCrud, useForm, useTable } from "@cool-vue/crud";
import { useCool } from "/@/cool";
import { type PropType, computed, nextTick, reactive, ref, watch } from "vue";
import { cloneDeep, isEmpty } from "lodash-es";
import { cloneDeep, isArray, isEmpty } from "lodash-es";
import { CircleClose } from "@element-plus/icons-vue";
//
@ -271,6 +271,11 @@ function close() {
visible.value = false;
}
//
function set(data: Item[] | Item) {
list.value = cloneDeep(isArray(data) ? data : [data]);
}
//
function select(item?: Item) {
// onSelectionChange
@ -329,6 +334,7 @@ watch(
);
defineExpose({
set,
remove,
select,
selectAll

View File

@ -1,10 +1,14 @@
<template>
<div class="cl-view-head">
<div class="cl-view-head" :class="{ 'is-border': border }">
<el-icon class="cl-view-head__back" @click="router.back()">
<arrow-left />
</el-icon>
<span class="cl-view-head__title">{{ title }}</span>
<div class="op">
<slot name="op"></slot>
</div>
</div>
</template>
@ -14,7 +18,8 @@ import { useCool } from "/@/cool";
import { ArrowLeft } from "@element-plus/icons-vue";
const props = defineProps({
title: String
title: String,
border: Boolean
});
const { route, router } = useCool();
@ -47,6 +52,12 @@ const title = computed(() => props.title || route.query.title);
&__title {
font-size: 14px;
line-height: 1;
margin-right: auto;
}
&.is-border {
border-bottom: 1px solid var(--el-border-color-light);
padding-bottom: 10px;
}
}
</style>