Skip to content

Commit

Permalink
style(message): add types/remove $data and $props
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwoodland committed May 31, 2022
1 parent 4e03a87 commit dbfef1b
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions components/views/chat/message/edit/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ import { Config } from '~/config'
import { KeybindingEnum } from '~/libraries/Enums/enums'
import Editable from '~/components/views/chat/chatbar/Editable.vue'
declare module 'vue/types/vue' {
interface Vue {
saveMessage: Function
cancelMessage: Function
lengthCount: number
charlimit: boolean
}
}
export default Vue.extend({
components: {
SmileIcon,
Expand All @@ -40,22 +31,22 @@ export default Vue.extend({
}
},
computed: {
lengthCount() {
return this.$data.content.length
lengthCount(): number {
return this.content.length
},
charlimit() {
charlimit(): boolean {
return this.lengthCount > this.maxChars
},
},
mounted() {
this.$data.content = this.$props.message
this.content = this.message
},
methods: {
saveMessage() {
if (this.$data.content.length === 0) {
if (this.content.length === 0) {
return
}
this.$emit('commitMessage', this.$data.content.slice(0, this.maxChars))
this.$emit('commitMessage', this.content.slice(0, this.maxChars))
},
cancelMessage() {
this.$emit('cancelMessage')
Expand Down

0 comments on commit dbfef1b

Please sign in to comment.