suppose
request address varies according to different websites
when configuring multiple different URLs
how to directly modify the configuration file to change the request address without having to package again
suppose
request address varies according to different websites
when configuring multiple different URLs
how to directly modify the configuration file to change the request address without having to package again
Let's start with a question: what triggers packaging again?
modifying the program code will trigger packaging again
well, let's figure out how many solutions we can deal with without modifying the code.
ajax
request the configuration file, which is set through the configuration file.
/
. /
.. /
webpack
to simplify it, so I want to import config from config
. So take a look at externals
of webpack
. use environment variables, one is development environment and the other is production environment. The prefix of
environment variables is to create two new files with VUE_APP
, as shown below
env.development
NODE_ENV=production
VUE_APP_URL=http://www.demo3.com
VUE_APP_DEMO_URL=http://www.demo4.com
in use process.env.VUE_APP_URL
or VUE_APP_DEMO_URL
vue.js implements specification selection on product details page Click to select version option and click to select color option. Highlight has been selected. How to display the selected version and color html Code < div class= "chose-ck " > : ...
build the project: vue init webpack my-app with vue scaffolding After , I want to introduce css file structure directory main.jsimport what is the reason for this ...
although it is said that the use of webpack webpack-dev-server, and then with babel transcoding, coupled with a variety of loaders and plugins can really be better, targeted to build a development environment. but these configurations take too much ti...
1. The project initialization statement vue init webpack vuex-iview 2.ESLint is preceded by y and followed by n 3. After initialization, cd vuex-iview then npm run dev 4. Next, I reported an error (I posted a full screenshot below). I have tried to re...
as shown in figure I really can t find it. Ask for help ...
use cordova to package the vue project because apk, cannot connect to the network, and network pictures are not displayed ...
suppose a vue-cli single-page application has parent and child components, as well as non-parent-child components. When I click on a child component, that is, by adding a route to a child component (or a non-parent component), the problem arises. What if...
access the project file in www.a.com HMall, which contains static and index.html, but the background image in css cannot be found. The address of the accessed image is www.a.com static icon.png,. The real image address is www.a.com HMall static icon.png...
Environment, version: node: 8.9.3 webpack: 3.6.0 vue: 2.2.2 vue-cli: 2.x webpack is a template that uses vue-cli. After packaging, an error is displayed on the WeChat end of ios, while Android is fine: prompt that there is an error ...
how to imitate the Alipay password pop-up window in the vue single page? ask for advice ...
after I created the webpack template with vue-cli, I wanted to try to use eslint to standardize the code format. then change indent_size = 2 to 4 in the .editorconfig file. found that it didn t work. later found that the code format check is b...
Build complete. Tip: built files are meant to be served over an HTTP server. Opening index.html over file: won t work. after npm run build is generated, it prompts me that I need to run under the http server. How can I set it up so that I can ...
what a waste of time ask why this is caused by Why can t upload pictures, kindly tired ...
node: 8.11.1 npm: 5.6.0 vue: "^ 2.5.2 ", vue-cli@2.9.3 ...
this question has puzzled me all the time import modules into components like this. For example, I have to rely on these things for many components. and then import them one by one. Will you repeatedly package these modules into the code when packi...
now you need to change the style of an element on the page based on the current route when the page jumps to a route. Boss, don t just talk about ideas, but also talk about the specific implementation code. I am relatively bad, a lot of grammar is not ...
question: vue-cli modifies the file under MAC. It doesn t compile automatically, and it doesn t report an error. What s going on here? Action: the webstorm I used turned off the safewrite and it didn t work. Changing the editor won t work. I can t...
the current situation is I finished developing the vue project, packed it into the test environment, specified the xxx.com domain name with nginx to this static file, and then I can access it. the backend uses the tomecat server. When the backend s...
in vue, this is a window departure event. I want to change the style of body through this, but it seems to have misreported . how can I change its style? ...
I ve been learning vue for some time, and it s good to use it for simple project exercises. I just have a question for the time being. Such as the title, is that so? Do you need to pay attention to anything backstage? I have not done anything like this...