title: How to fix Uncaught (in promise) TypeError: Cannot set property of undefined
body: <p>I get an error when I want to send the value from the API results to the data, the error is like this</p>
  <pre><code>Uncaught (in promise) TypeError: Cannot set property 'notification' of undefined at eval (HeaderPortal.vue?070f:367)
  </code></pre>
  <p>this my HeaderPortal.vue</p>
  <pre><code>    data() {
        return {
          notification: []
        }
      }
      methods: {
          const res = this.GET('/api/v2/notification', 'BEARER', null).then( function(res) {
            console.log(JSON.parse(res))
            this.notification = JSON.parse(res);
          });
      }
  </code></pre>
  <p>this.GET comes from here</p>
  <pre><code>methods: {
          async GET(url, headers, callback) {
              const options = headers === 'BASIC' ? HEADERS_BASIC : HEADERS_BEARER;
              try {
                  const response = await axios.get(`${BASE_URL}${url}`, options);
                  return (JSON.stringify(response));
              } catch (e) {
                  console.error(e);
              }
          },
  }
  </code></pre>
  <p>how to handle it? is there something wrong in my code?</p>