vue中axios获取到的值如何再次引用
<script>
export default {
name: '',
data() {
return {
user:'',
id:''
}
},
props: {},
computed: {},
methods: {
},
mounted () {
axios.get('/api/extensys/exten_action.php?act=get_userinfo&unionid=oaNquuJBYcTrl4EJOXYaINXN7xZo')
.then((response) => {
this.user = response.data.userInfo
this.id = response.data.loginResult.player.userid
// console.log(this.id)
// console.log(this.user)
})
axios.get('/api/extensys/action.php?act=get_levelinfo&userid=')
.then((response) => {
// this.user = response.data
console.log(response.data)
})
}
}
</script>
图中第一次axios获取到的 this.id = response.data.loginResult.player.userid userid的值作为第二次 axios.get('/api/extensys/action.php?act=get_levelinfo&userid=') userid中的参数
怎么把userid的值调用
...全文
相关推荐
vue异步axios获取的数据渲染到页面的方法
今天小编就为大家分享一篇vue异步axios获取的数据渲染到页面的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
vueaxios将axios整合到VueJS的封装
vue-axios:将axios整合到VueJS的封装
vue获取form表单的值示例
今天小编就为大家分享一篇vue获取form表单的值示例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
Vue.js使用axios动态获取response里的data数据操作
今天开发时,使用axios返回的response中data有多个数据: 如果是获取cn里的数据的,可以用: response.data.cn 但是需求是根据选择来获取数据的,会发生变化,最开始的想法是,用一个变量来记录需要获取的key: 假设need是需要获取的某个key const dkey = this.need; response.data.dkey 这样发现获取不到数据,这是因为vue.js把dkey当成data里的某一个key了,类似于上面的”cn”。 折腾了很久才突然想起,这个data其实类似一个数组,我们可以像使用数组一样使用它,后面发现的确是可行的 const dk
invoicex_vuejs:VueJS | vue-cli,vue-router,vuex,axios,bulma css
发票VueJS VueJS前端


