既に入力されているタグを二重追加しない

This commit is contained in:
shibafu 2019-06-26 23:23:06 +09:00
parent da19806a3d
commit 0ad0b268bc

View File

@ -30,7 +30,7 @@
buffer: string = ""; buffer: string = "";
created() { created() {
bus.$on("add-tag", (tag: string) => this.tags.push(tag)); bus.$on("add-tag", (tag: string) => this.tags.indexOf(tag) === -1 && this.tags.push(tag));
} }
onKeyDown(event: KeyboardEvent) { onKeyDown(event: KeyboardEvent) {
@ -79,4 +79,4 @@
border: 0; border: 0;
outline: 0; outline: 0;
} }
</style> </style>