Merge branch '250328_comment'
All checks were successful
LocalNet_front/pipeline/head This commit looks good

This commit is contained in:
nevermoregb 2025-03-28 14:00:01 +09:00
commit 21165d1d54
2 changed files with 18 additions and 16 deletions

View File

@ -38,7 +38,7 @@
<textarea v-model="localEditedContent" class="form-control"></textarea>
<span v-if="editCommentAlert" class="invalid-feedback d-block text-start">{{ editCommentAlert }}</span>
<div class="mt-2 d-flex justify-content-end">
<SaveBtn class="btn btn-primary" @click="submitEdit"></SaveBtn>
<SaveBtn class="btn btn-primary" @click="submitEdit" :isEnabled="disabled"></SaveBtn>
</div>
</template>
@ -142,6 +142,8 @@
};
const localEditedContent = ref(props.comment.content);
const isModifyContent = ref(props.comment.content);
const disabled = ref(false);
//
const isComment = ref(false);
@ -182,6 +184,11 @@
watch(
() => localEditedContent.value,
newVal => {
if (JSON.stringify(isModifyContent.value) == JSON.stringify(newVal)) {
disabled.value = false;
return;
}
disabled.value = true;
emit('inputDetector');
},
);

View File

@ -1,23 +1,18 @@
<template>
<button
type="button"
class="btn btn-primary ms-1"
@click="$emit('click')"
:disabled="!isEnabled"
>
<button type="button" class="btn btn-primary ms-1" @click="$emit('click')" :disabled="!isEnabled">
<i class="bx bx-check"></i>
</button>
</template>
<script>
export default {
name: "SaveButton",
name: 'SaveButton',
props: {
isEnabled: {
type: Boolean,
default: true, //
},
},
emits: ["click"],
emits: ['click'],
};
</script>