Skip to content

Commit

Permalink
fix: 修复类型错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
likaia committed Dec 30, 2020
1 parent 83b306e commit dcc2439
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/type/ComponentDataType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export type totalMessage = {

// 本地消息列表数据类型定义
export type localMsgObj = {
id: string; // 列表id
id?: string; // 列表id
lastMsgTxt?: string; // 最后一条消息内容
lastTime?: string; // 最后一条消息发送时间
};
Expand Down
2 changes: 1 addition & 1 deletion src/views/msg-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default defineComponent({
msgObj.id = data.id;
msgObj.lastMsgTxt = data.text;
msgObj.lastTime = data.time;
localStorage.setItem("msgList", [msgObj]);
localStorage.setItem("msgList", JSON.stringify([msgObj]));
}
// 更新消息列表中的消息内容与时间
for (let i = 0; i < this.msgList.length; i++) {
Expand Down

0 comments on commit dcc2439

Please sign in to comment.