From bd6ae251e418e737eb97ad03801f5989c47f9311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E4=BB=99=E9=83=BD=E6=B2=A1=E7=94=A8?= <615206459@qq.com> Date: Thu, 14 Dec 2023 22:23:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- packages/crud/package.json | 2 +- packages/crud/src/components/table/helper/header.tsx | 6 +++++- packages/crud/src/static/index.scss | 10 ++++++++++ src/modules/demo/views/crud.vue | 1 + stats.html | 2 +- yarn.lock | 8 ++++---- 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index a379a86..8a8749b 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint:eslint": "eslint \"./src/**/*.{vue,ts,tsx}\" --fix" }, "dependencies": { - "@cool-vue/crud": "^7.0.9", + "@cool-vue/crud": "^7.0.10", "@element-plus/icons-vue": "^2.1.0", "@vueuse/core": "^10.4.0", "@wangeditor/editor": "^5.1.23", diff --git a/packages/crud/package.json b/packages/crud/package.json index a4308f1..a3af521 100644 --- a/packages/crud/package.json +++ b/packages/crud/package.json @@ -1,6 +1,6 @@ { "name": "@cool-vue/crud", - "version": "7.0.9", + "version": "7.0.10", "private": false, "main": "./dist/index.umd.min.js", "typings": "types/index.d.ts", diff --git a/packages/crud/src/components/table/helper/header.tsx b/packages/crud/src/components/table/helper/header.tsx index a43a69b..6f37748 100644 --- a/packages/crud/src/components/table/helper/header.tsx +++ b/packages/crud/src/components/table/helper/header.tsx @@ -54,5 +54,9 @@ export function renderHeader(item: ClTable.Column, { scope, slots }: any) { } }); - return ; + return ( +
+ {item.search.isInput ? input : text} +
+ ); } diff --git a/packages/crud/src/static/index.scss b/packages/crud/src/static/index.scss index 5fff31e..5db81bf 100644 --- a/packages/crud/src/static/index.scss +++ b/packages/crud/src/static/index.scss @@ -72,6 +72,16 @@ .cell { line-height: normal; } + + &.is-sortable { + .cl-table-header__search { + width: auto; + + &.is-input { + width: calc(100% - 24px) !important; + } + } + } } } diff --git a/src/modules/demo/views/crud.vue b/src/modules/demo/views/crud.vue index ffb831e..02df15d 100644 --- a/src/modules/demo/views/crud.vue +++ b/src/modules/demo/views/crud.vue @@ -450,6 +450,7 @@ const Table = useTable({ orderNum: 1, minWidth: 165, prop: "createTime", + sortable: "custom", search: { component: ( diff --git a/stats.html b/stats.html index afefacb..557e60e 100644 --- a/stats.html +++ b/stats.html @@ -4818,7 +4818,7 @@ var drawChart = (function (exports) {