|
@ -95,15 +95,14 @@ |
|
|
</v-card> |
|
|
</v-card> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
import Vue from 'vue' |
|
|
import Vue from 'vue' |
|
|
import VueFilterDateFormat from '@vuejs-community/vue-filter-date-format' |
|
|
import VueFilterDateFormat from '@vuejs-community/vue-filter-date-format' |
|
|
import VueFilterDateParse from '@vuejs-community/vue-filter-date-parse' |
|
|
import VueFilterDateParse from '@vuejs-community/vue-filter-date-parse' |
|
|
Vue.use(VueFilterDateFormat) |
|
|
Vue.use(VueFilterDateFormat) |
|
|
Vue.use(VueFilterDateParse) |
|
|
Vue.use(VueFilterDateParse) |
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
|
name: 'Comment', |
|
|
|
|
|
|
|
|
export default Vue.extend({ |
|
|
props: { |
|
|
props: { |
|
|
comment: { |
|
|
comment: { |
|
|
required: true, |
|
|
required: true, |
|
@ -114,26 +113,29 @@ export default { |
|
|
type: Number |
|
|
type: Number |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
showEdit: false, |
|
|
showEdit: false, |
|
|
editText: this.comment.text, |
|
|
editText: this.comment.text, |
|
|
commentRules: [ |
|
|
commentRules: [ |
|
|
v => !!v.trim() || 'Comment is required' |
|
|
|
|
|
|
|
|
(v: string) => !!v.trim() || 'Comment is required' |
|
|
], |
|
|
], |
|
|
valid: false |
|
|
valid: false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
updateComment(newText) { |
|
|
|
|
|
|
|
|
updateComment(newText: string) { |
|
|
this.showEdit = false |
|
|
this.showEdit = false |
|
|
const comment = {...this.comment, text:newText } |
|
|
const comment = {...this.comment, text:newText } |
|
|
this.$emit('update-comment', comment) |
|
|
this.$emit('update-comment', comment) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
cancel() { |
|
|
cancel() { |
|
|
this.showEdit = false |
|
|
this.showEdit = false |
|
|
this.editText = this.comment.text |
|
|
this.editText = this.comment.text |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
</script> |
|
|
</script> |