mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
优化
This commit is contained in:
parent
1e1296d14d
commit
5a51d07c6d
@ -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
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user