Skip to content

Commit

Permalink
Fix: hide room
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyCreeper committed Oct 25, 2023
1 parent 9339bdb commit f340de9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/services/apis/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export const createRoomApi = useDefineApi<
data: {
roomName: string;
password: string;
hidden: boolean;
setting: {
hidden: boolean;
};
};
headers: { Authorization: string };
},
Expand Down
9 changes: 5 additions & 4 deletions src/views/CreateRoom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const { state: createRoomInfo, execute: reqCreateRoomApi } = createRoomApi();
const formData = ref({
roomName: "",
password: "",
hidden: false
setting: {
hidden: false
}
});
const operateRoom = async () => {
Expand Down Expand Up @@ -70,10 +72,9 @@ const operateRoom = async () => {
<br />
<input class="l-input" type="password" v-model="formData.password" placeholder="房间密码" />
<br />

<div>
<input class="w-auto" type="checkbox" v-model="formData.hidden" />
<label class="mr-6" title="不显示在房间列表">&nbsp;是否隐藏此房间</label>
<input class="w-auto" type="checkbox" v-model="formData.setting.hidden" />
<label title="不显示在房间列表">&nbsp;是否隐藏此房间</label>
</div>
<button class="btn m-[10px]" @click="operateRoom()">创建房间</button>
<div class="text-sm"><b>注意:</b>所有输入框最大只可输入32个字符</div>
Expand Down

0 comments on commit f340de9

Please sign in to comment.