Skip to content

Commit a366b07

Browse files
Rockyjevin98
authored andcommitted
!490 chore(vue-shim.d.ts): 添加 .vue 文件类型定义以支持 WebStorm 原生校验。
* refactor(TableToolbar): type support * refactor(TableToolbar): .vue 文件引入避免桶文件方式 * refactor(vue-shim.d.ts): 添加 .vue 文件类型定义以支持 WebStorm 原生校验。 * refactor(TableToolbar): 导入路径移除默认索引后缀 */index.vue
1 parent 59b8287 commit a366b07

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default antfu(
1616
"**/*.md",
1717
"docs/",
1818
"**/*.test.*",
19+
"**/*.d.ts",
1920
],
2021

2122
stylistic: {

packages/component/component/table/components/TableToolbar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import LayDropdown from "@layui/component/component/dropdown/index.vue";
99
import LayIcon from "@layui/component/component/icon";
1010
import LaySpace from "@layui/component/component/space/index.vue";
1111
import { isValueArray } from "@layui/component/utils";
12+
1213
import { defineComponent, h, inject } from "vue";
1314
import { LAY_TABLE_CONTEXT } from "../constant";
1415
import { useToolBar } from "../hooks/useToolbar";
@@ -111,7 +112,7 @@ const TableToolbar = defineComponent({
111112
props: {
112113
defaultToolbar: {
113114
required: true,
114-
type: Array as PropType<TableToolBarType["defaultToolbar"]>,
115+
type: [Array, Boolean] as PropType<TableToolBarType["defaultToolbar"]>,
115116
},
116117

117118
hierarchicalColumns: {
@@ -136,7 +137,7 @@ const TableToolbar = defineComponent({
136137

137138
tableRef: {
138139
required: true,
139-
type: Object as PropType<TableToolBarType["tableRef"]>,
140+
type: [Object, null] as PropType<TableToolBarType["tableRef"]>,
140141
},
141142
},
142143

packages/component/vue-shim.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
declare module "*.vue" {
2+
import type { DefineComponent } from "vue";
3+
4+
const component: DefineComponent<{}, {}, any>;
5+
6+
export default component;
7+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy