hjortur17
140
2
Vue

Unexpected token

Posted 3 months ago by hjortur17

Hi, I can't figure out why i'm getting syntax error when trying to this:

axios.get("/api/" . window.App.user.username . "/tilkynningar")
                .then(response => this.notifications = response.data);

Here is the error:

SyntaxError: /Users/hjorturfreyrlarusson/websites/project/resources/js/components/UserNotifications.vue: Unexpected token (24:54)

created() {
axios.get("/api/" . window.App.user.username . "/tilkynningar")
                                                ^
    .then(response => this.notifications = response.data);

I have this in my bootstrap.js file:

window.Vue = require('vue');

Vue.prototype.authorize = function(handler) {
    let user = window.App.user;

    return user ? handler(user) : false;
};

Please sign in or create an account to participate in this conversation.