修复 bug

This commit is contained in:
zhbaor 2021-04-24 21:29:32 +08:00
parent 76e807e25e
commit 9c249cd357

11
src/App.vue Executable file → Normal file
View file

@ -59,7 +59,13 @@
</div>
<b-form class="d-flex m-3" @submit.prevent="sendMessage">
<b-form-input class="flex-fill mr-2" v-model="message"> </b-form-input>
<b-button pill variant="success" type="submit">Button</b-button>
<b-button
:disabled="message.length == 0"
pill
variant="success"
type="submit"
>Send</b-button
>
</b-form>
</div>
</div>
@ -89,7 +95,7 @@ export default class App extends Vue {
if (chineseChar.test(firstChar)) {
return firstChar;
} else {
return this.nickname.substring(0, 2);
return nickname.substring(0, 2);
}
}
public login(): void {
@ -105,6 +111,7 @@ export default class App extends Vue {
}
public sendMessage(): void {
ipcRenderer.send("message", this.message);
this.message = "";
}
mounted(): void {
ipcRenderer.on("message", (_, nickname, message) => {