Skip to content

Commit

Permalink
fix: ts type initial value
Browse files Browse the repository at this point in the history
  • Loading branch information
thxl2010 committed Feb 24, 2022
1 parent a484293 commit 96a6f1a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/api/types/product-reply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export interface IReply {
}

export interface ISelectedProduct {
image: string; // 商品图
product_id: number; // 商品ID
image?: string; // 商品图
product_id?: number | null; // 商品ID
}

export interface IVirtualReply {
Expand Down
1 change: 1 addition & 0 deletions src/views/product/reply/Product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ watch(
.el-table {
margin-bottom: 1em;
}
// ::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead.
::v-deep .el-image {
height: 36px;
}
Expand Down
5 changes: 4 additions & 1 deletion src/views/product/reply/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ const handleDialogClosed = () => {
};
// product
const handleSelectProduct = (id: IProduct['id'], image: IProduct['image']) => {
const handleSelectProduct = (
id: IProduct['id'] | null,
image: IProduct['image']
) => {
formData.value.image.product_id = id;
formData.value.image.image = image;
};
Expand Down

0 comments on commit 96a6f1a

Please sign in to comment.