如何在nativescript vue上使用axios
您好,我正在尝试从后端获取数据,但它看起来不工作,也无法调试负载上发生的事情 我确实试过这样的东西如何在nativescript vue上使用axios,nativescript,nativescript-vue,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 }) 没有发生任何事情没有控制台记录任何事情
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)
});
仍然不工作如何才能做到这一点我是nativescript新手,但我知道vue您的API是http而不是https。在iOS和Android(Pie-v9及以上版本)中,默认情况下不允许不安全的连接。你做了所有的设置吗?哦,好的,让我测试一下https谢谢