1

The error is happening in the method messageSubmit
The error reads Uncaught TypeError: Cannot read property 'messages' of undefined
Here's the whole code:

export default {
  name: 'App',
  methods: {
    messageSubmit: () => {
      this.messages.push({ username: this.username, text: this.messageValue });
    }
  },
  data() {
    return {
      messageValue: '',
      messages: [],
      username: 'Nobody'
    };
  }
};

enter image description here

LouieMartin
  • 37
  • 1
  • 7

0 Answers0