如何在nativescript-vue上使用axios

时间:2019-10-03 17:20:07

标签: nativescript nativescript-vue

您好,我正在尝试从后端获取数据,但是看起来不起作用,也无法调试加载时发生的情况

我确实尝试过类似的事情

import axios from 'axios/dist/axios';

axios.get('http://api.chillwisper.tk/api/videos')
.then(response => {
  console.log(response.data);
  this.videos = response.data.data
})

什么都没有发生,没有控制台什么也没记录
我也试过了

fetch("http://api.chillwisper.tk/api/videos")
            .then((response) => {
                console.log(response.data);
                console.log('this is test shit')
                this.videos = response.data.data
            })
            .catch((e) => {
                console.log(e.response)
            });

仍然无法正常工作,该怎么做?我是原生脚本的新手,但我知道vue

0 个答案:

没有答案