vue.为不同设备自动适配样式,以及stylus的使用前提

为不同设备自动适配样式

http://cssreset.com    下载

Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)

得到reset.css文件,放在    项目目录/static/css

然后在    根目录/index.html中head标签间添加使用reset.css的代码

  <link rel="stylesheet" type="text/css" href="static/css/reset.css">

还要再添加为不同设备适配尺寸的代码

  <meta name="viewport"

        content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">


stylus的使用前提

使用npm 安装

npm install stylus --save-dev

npm install

给需要的vue组件中的标签添加属性


<style lang="stylus" rel="stylesheet/stylus">

进入package。json文件 "devDependencies": { 中添加依赖

    "stylus": "^0.54.5",
    "stylus-loader": "^3.0.1",


猜你喜欢

转载自blog.csdn.net/qq_37828633/article/details/79920302