编程人 cdmana.com

Vue agent configuration (Vue + Django front end and back end separation project)

This project is to use webpack The initialization of the vue project . The specific version is as follows :

    "vue": "^2.5.2",
    "vuex": "^3.6.0",
    "webpack": "^3.6.0",
    "webpack-dev-server": "^2.9.1",

Set up the back end ip, modify config/index.js file , The others don't need to be changed .

    proxyTable: {
      '/api': {
        target: 'http://127.0.0.1:8000',// Set the domain name and port number of the interface you call   Don't forget to add http
        changeOrigin: true,// If you need to cross domains 
      }
    },

Reprint please indicate :

WeChat official account : Data log

Simple books : Data log

Blog Garden :https://www.cnblogs.com/wheng/

CSDN:https://blog.csdn.net/wzgl__wh

Scroll to Top