nuxt.js initialization page calls jsonp error document is not defined
methods event method calls can be
<script>
import axios from "axios"
import jsonp from "jsonp"
import AppLogo from "~/components/AppLogo.vue"
import test from "~/components/test.vue"
//import Button from "~/components/Button.vue"
import Message from "~/components/Message.vue"
export default {
//middleware: "auth",
data() {
return {
bidName:""
}
},
created:function(){
},
async asyncData(callback){
jsonp("xxxx",null,(err,data)=>{
if(err){
console.log(err.Message);
}else{
console.log(data);
//return {info:data}
}
}).then((res)=>{
return {info:res.data}
})
},
components: {
AppLogo,
test,
//Button,
Message
},
methods:{
async gety(){
jsonp("xxx",null,(err,data)=>{
if(err){
console.log(err.Message);
}else{
console.log(data);
this.bidName=data.model.productList[0].financial.bidName;
//return {info:data}
}
})
}
}
}
</script>