Skip to content

Commit

Permalink
fix: ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
YasinChan committed Apr 2, 2024
1 parent 96124ca commit b580d09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/WordInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ function getTypingRecord() {
return state.typingRecord;
}
function shortenString(str) {
function shortenString(str: string) {
// 如果字符串长度小于等于3,则不需要截断,直接返回原字符串
if (str.length <= 3) {
return str;
Expand Down
4 changes: 2 additions & 2 deletions src/view/Game.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ onMounted(() => {
Promise.allSettled([configDeferred, userProfileDeferred]).then(async () => {
// 等这俩都执行完了,不管成功与否都会到这里来。
await nextTick();
const op = router.currentRoute.value?.query?.op;
const op = router.currentRoute.value?.query?.op as string;
// 这里是判断是否是分享链接的
if (op) {
// 这表示是复制过来的
enterRoom({
op: op,
player: [],
time: 0,
count: ''
count: 0
});
}
});
Expand Down
3 changes: 2 additions & 1 deletion src/view/GameRoom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ function ready() {
}
// 房主可以讲别人踢出去
function removePlayer(player) {
function removePlayer(player: string | number) {
state.ws.send(
JSON.stringify({
id: routerId.value,
Expand Down Expand Up @@ -528,6 +528,7 @@ function shareRoom() {
clipboard.destroy();
});
// @ts-ignore
clipboard.onClick(event);
}
Expand Down

0 comments on commit b580d09

Please sign in to comment.