diff --git a/src/modules/user/components/select.vue b/src/modules/user/components/select.vue index e6f415b..3440a87 100644 --- a/src/modules/user/components/select.vue +++ b/src/modules/user/components/select.vue @@ -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 diff --git a/src/plugins/view/components/head.vue b/src/plugins/view/components/head.vue index b529886..030f7e6 100644 --- a/src/plugins/view/components/head.vue +++ b/src/plugins/view/components/head.vue @@ -1,10 +1,14 @@ @@ -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; } }