review:【antd 全局】vxe-table 单独使用的封装

pull/101/head
YunaiV 2025-05-12 13:16:47 +08:00
parent 0f44d460e2
commit 2a27e5001d
2 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* 来自 @vben/plugins/vxe-table style.css */ /* 来自 @vben/plugins/vxe-table style.css TODO @puhui999可以写下目的哈 */
:root { :root {
--vxe-ui-font-color: hsl(var(--foreground)); --vxe-ui-font-color: hsl(var(--foreground));
--vxe-ui-font-primary-color: hsl(var(--primary)); --vxe-ui-font-primary-color: hsl(var(--primary));

View File

@ -3,6 +3,7 @@ import type { TableToolbar } from '#/components/table-toolbar';
import { ref, watch } from 'vue'; import { ref, watch } from 'vue';
// TODO @puhui999这里的注释、目的写下
export function useTableToolbar() { export function useTableToolbar() {
const hiddenSearchBar = ref(false); // 隐藏搜索栏 const hiddenSearchBar = ref(false); // 隐藏搜索栏
const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>(); const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>();
@ -14,6 +15,7 @@ export function useTableToolbar() {
const table = tableRef.value; const table = tableRef.value;
const tableToolbar = tableToolbarRef.value; const tableToolbar = tableToolbarRef.value;
if (table && tableToolbar) { if (table && tableToolbar) {
// TODO @puhui999通过 nexttick 可以解决么?
setTimeout(async () => { setTimeout(async () => {
const toolbar = tableToolbar.getToolbarRef(); const toolbar = tableToolbar.getToolbarRef();
if (!toolbar) { if (!toolbar) {
@ -29,6 +31,7 @@ export function useTableToolbar() {
() => tableRef.value, () => tableRef.value,
(val) => { (val) => {
if (!val || isBound.value) return; if (!val || isBound.value) return;
// TODO @puhui999这里要处理下 promise 的告警么?
bindTableToolbar(); bindTableToolbar();
}, },
{ immediate: true }, { immediate: true },