简体   繁体   中英

How to axios.patch () data from a vuex store

I've been at it for days but i keep getting errors and no update to the api data. This is the code in my store.. The issue is with the update user action

this is an update

the action in store

    async updateUsers(id){
     await axios.patch(`${resource_url}${id}`, id).then(response => {
     console.log(response.data)  
     })
    }

the click method that is dispatching the action

methods: {
    renameUsers(){
        this.$store.dispatch('updateUsers')
    }
}

ive been trying a mix of fixes so see what works so the code keeps changing alot.

我看不到你是否在 dispatch 中传递了 id

this.$store.dispatch('updateUsers', /* pass id here */)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM