Since JQ has Ajax methods, then Axios has no Axios method. The answer is yes, still hiding the domain name
1. Configure Config/index.js: Troubleshoot cross-domain issues dev: {env:require ('./dev.env '), port:8008, Autoopenbrowser:false, Assetssubdirector Y: ' Static ', Assetspublicpath: '/', proxytable: {'/ajaxurl ': {target: ' https://www.aaaaaaa.com/', Changeo Rigin:true, Pathrewrite: {' ^/ajaxurl ': '/'}}} 2.main.js: Configure Axios to prototype chain, note 25th line import Vue from
' Vue ' import App from '/app ' import Axios from ' Axios ' Vue.prototype. $http =axios; New Vue ({el: ' #app ', render:h => H (APP)}) 3.app.vue: Use request, get for example, line 45th to 60th behavior method, prefer this <template> <div id= "App" > huoqu <button @click = "Myajax" > Get home Information </button> </div> </template> <script> ex Port Default {name: ' app ', components: {}, Data:function () {}, methods: {myajax:function () {this. $http
({method: ' Get ', url: '/ajaxurl/welfare/gpa/brand/list ', data: {page:1, size:10}
}). Then (response => {console.log ("successful Request"); ConsOle.log (response);
}, Response => {console.log ("request Failed");
Console.log (response); })},}} </script> <style> </style>
The effect chart is as follows: