• 2024-05-16vue-cli项目处理vant自适应问题
    原因vant自带的样式,用的单位是px,无法自适应。一般有两种处理思路。一、写媒体查询安装插件postcss-pxtorem:用于将单位px转化为rem//安装命令npmi-Dpostcss-pxtoremlib-flexible:给html标签设置font-size,作为rem基准值(因为我的项目已经脚本处理了,所以我是没有
  • 2024-02-23vue3+vite 移动端适配postcss-pxtorem插件
    1、安装插件npmipostcss-pxtorem-D2、与package.json同级目录创建postcss.config.js文件module.exports={plugins:{autoprefixer:{overrideBrowserslist:["Android4.1","iOS7.1",
  • 2023-12-29Rem部署适配
    参考vant官网:https://vant-contrib.gitee.io/vant/v3/#/zh-CN/advanced-usage两个插件:1.postcss-pxtorem是一款PostCSS插件,用于将px单位转化为rem单位2.lib-flexible用于设置rem基准值3.示例配置//postcss.config.jsmodule.exports={plugins:{'p
  • 2023-11-03postcss-pxtorem 使用和问题
    postcss-pxtorem是存放在postcss.config.js文件里的。结构如下:module.exports={ plugins:{  autoprefixer:{},  'postcss-pxtorem':{   rootValue({file}){    return10//尺寸   },   propList:['*'],   //替
  • 2023-08-29移动端/H5/rem 开发,使用lib-flexible 和 postcss-pxtorem适应不同分辨率
    一、安装 1.直接使用npm包管理工具进行下载npminstalllib-flexible--savenpminstallpostcss-pxtorem--save*如果报错:“Error:PostCSSpluginpostcss-pxtoremrequiresPostCSS8.”报错的意思是postcss-pxtorem为8.0,但实际上官网最新版本为6.0(有可能是6.0版本与v
  • 2023-08-29px转rem适配方案之postcss-pxtorem
    一、安装npminstallpostcss-pxtorem--save-dev二、增加postcss.config.js文件在目录文件下增加postcss.config.js并添加相关配置//https://github.com/michael-ciniawsky/postcss-load-configmodule.exports={'plugins':{//toedittargetbrowsers:use
  • 2023-07-30vue移动端适配
    1.安装[email protected]是可配置可伸缩布局方案,主要是将1rem设为viewWidth/10。  postcss-pxtorem是postcss的插件,用于将像素单位生成rem单位。2.在vue.config.js中引入module.exports={css:{lo
  • 2023-07-13vue 适配
    vue适配1.amfe-flexibleamfe-flexible是配置可伸缩布局方案,主要是将1rem设为viewWidth/10。2.postcss-pxtorempostcss-pxtorem是postcss的插件,用于将像素单元生成rem单位。先安装amfe-flexible和postcss-pxtoremnpminstallamfe-flexible--savenpminstallpostcss-pxto
  • 2023-03-02vue+vant项目中 rem适配配置
    vantrem适配,需要安装两个插件postcss-pxtorem 是一款postcss插件,用于将单位转化为rem  lib-flexible 用于设置rem基准值postcss-pxtorem:npminstallpostc
  • 2022-11-29vue3-vite下配置postcss-pxtorem进行移动端适配
    如果使用Vue进行移动端页面的开发,需要对不同机型的宽高进行适配。最常用的方法是使用amfe-flexable和postcss-pxtorem这两个插件来帮助进行适配。amfe-flexableamfe-flex
  • 2022-11-21vue3+vant移动端适配 px转换rem
    Vant中的样式默认使用px作为单位,如果需要使用rem单位,推荐使用以下两个工具:postcss-pxtorem是一款postcss插件,用于将px单位转化为remlib-flexible用于设置re
  • 2022-11-01Vue项目配置postcss-pxtorem
    Vue2项目安装指定版本最新版本@6会报错:PostCSSpluginpostcss-pxtoremrequiresPostCSS8npmipostcss-pxtorem@5.1.1-D配置vue.config.jsmodule.exports=
  • 2022-08-31Vue Cli4.5版本手机端适配(rem)
    1.安装amfe-flexible(根据屏幕动态改变根元素font-size,postcss-pxtorem把代码中px转为rem)npmiamfe-flexible-S2.安装postcss-pxtorem(一款PostCSS插件,用于将px单位转