vue-webpack中引入jquery和bootstrap,使用jsonp-vue

vue-webpack中引入jquery和bootstrap
// 引入 https://blog.csdn.net/guorui_cara/article/details/78616281

使用jsonp-vue
// 安裝 install jsonp
// 引入 import jsonp from 'jsonp'
Vue.prototype.$jsonp = jsonp
var url = 'https://api.douban.com/v2/movie/top250?count=10'
this.$jsonp(url, null, (err, data) => {
    if (err) {
        console.error(err.message);
    } else {
        if (data) {
            console.log(data);
        }
    }
})複製代碼
相關文章
相關標籤/搜索