Giter Site home page Giter Site logo

vuepcandmobile's Introduction

test

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

响应式路由分发实现pc端和移动端兼容

优点:对比媒体查询,pc和移动端页面完全逻辑分离;
缺点:在开发阶段,电脑浏览器切换pc和移动屏幕的时候需要刷新才能触发路由跳转(但是这不会影响生产阶段客户的使用);
实现细节:
1、通过vue mixin封装 页面组件的beforeCreate钩子函数 ,钩子函数触发 judgePlatfom()方法,利用userAgent判断客户端设备pc还是移动端,进行对应端的页面跳转;
2、pc端使用element ui,移动端使用vant ui;
3、postcss-pxtorem插件需要设置两个rootValue分别对应pc端和移动端;

vuepcandmobile's People

Contributors

chantanya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.