Framework scheme of vuecli3 van t REM mobile terminal

Time:2019-11-8

describe

Based on vue-cli3.0 + webpack 4 + van UI + sass + REM adaptation scheme + Axios encapsulation, a mobile template scaffold is constructed

  1. vuecli3.0
  2. Multi environment development
  3. Axios encapsulation
  4. REM adaptation scheme

Multi environment development

Previously, I wrote a multi environment scheme, which is based on vue-cli2.0, the transport gate
Recently, the new project adopted the vuecli 3.0 and began to suffer a lot

The basic idea of Vue admin template is unchanged
Create a new config file in the SRC file to reference different configuration files according to different environments. The difference is that there are three files with environment variables set in the root directory
Here you can refer to Vue admin template

Framework scheme of vuecli3 van t REM mobile terminal

There is a problem here. Since there are files for setting variables according to different environments, why create three corresponding files under config?
I prefer this way of introduction. For example, I need to introduce api.common_apiin the file

import { api } from '@/config'
// api
const { common_api } = api

Framework scheme of vuecli3 van t REM mobile terminal

REM adaptation scheme

Or that sentence, VW or rem, that’s the question?

The reason why rem is chosen is that van t directly gives this adaptation scheme, and I like this scheme better

Framework scheme of vuecli3 van t REM mobile terminal

summary

Because the project has just been built and will be updated continuously later, there must be many problems in the actual use process. If there are errors in the article, I hope they can be corrected and grow together

Project GitHub address

About me

You can scan and add the wechat below and note soul plus exchange group, give me opinions, exchange and learn.

Framework scheme of vuecli3 van t REM mobile terminal

If I can help you, send me a little star

Reprint please contact the author!