Skip to content

Commit 6b268dc

Browse files
committed
fix types issues
1 parent 1baf01e commit 6b268dc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/plugins/materials/src/composable/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ export interface BlockResource {
6363
lifeCycles?: {
6464
[key: string]: TypeValuePair
6565
}
66-
id?: string
67-
type?: 'block'
66+
id?: string | number
67+
type?: string
6868
component?: string
6969
label?: string
7070
configure?: Configure
@@ -131,7 +131,7 @@ export interface BuildInfo {
131131
}
132132

133133
export interface Component {
134-
id?: number
134+
id?: number | string
135135
version?: string
136136
name: {
137137
zh_CN?: string

packages/plugins/materials/src/composable/useMaterial.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ const addMaterials = (materials: Material) => {
409409
addBlocks(materials.blocks)
410410
}
411411

412-
const getMaterial = (name: string): Resource | BlockResource | object => {
412+
const getMaterial = (name: string): Partial<Resource & BlockResource> => {
413413
if (name) {
414414
// 先读取组件缓存,再读取区块缓存
415415
return (

0 commit comments

Comments
 (0)