|
@@ -58,12 +58,16 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <input v-if="isRenaming" class="group-title-input" v-model="newName"
|
|
|
+ <input
|
|
|
+ v-if="isRenaming"
|
|
|
+ class="group-title-input"
|
|
|
+ v-model="newName"
|
|
|
ref="input-for-rename"
|
|
|
maxlength="50"
|
|
|
placeholder="输入名字"
|
|
|
@blur="onInputNewNameComplete"
|
|
|
@keydown.enter="onInputEnter"
|
|
|
+ @click.stop
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
@@ -201,7 +205,9 @@ export default {
|
|
|
},
|
|
|
onInputNewNameComplete() {
|
|
|
this.isRenaming = false
|
|
|
- this.$emit('renameGroup', this.groupNode.id, this.level, this.newName)
|
|
|
+ if (this.newName !== this.groupNode.name) {
|
|
|
+ this.$emit('renameGroup', this.groupNode.id, this.level, this.newName)
|
|
|
+ }
|
|
|
this.newName = ''
|
|
|
},
|
|
|
onInputEnter() {
|