jeudi 1 novembre 2018

Why append method not working with empty array in VueJS

I have a component with empty data array

data: () => ({
    selectedResource : [],
}),

but when i try to add some item to this array i got an error

    selectResource(resource){
        console.log(this.selectedResource);
        this.selectedResource.append(resource)
    }

this.selectedResource.append is not a function



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire