首页 > 其他分享 >vue3+vite自适应PC端

vue3+vite自适应PC端

时间:2023-04-25 18:23:10浏览次数:33  
标签:lib px2rem PC computer vue3 postcss vite

1、下载包
pnpm add lib-flexible-computer postcss-px2rem px2rem-loader -D
2、在main.ts里引入
import "lib-flexible-computer";
3、在vite.config.ts写入
import px2rem from "postcss-px2rem"

css: {
postcss: {
plugins: [
px2rem({
remUnit:192
})
]
}

 

 

原文链接:https://blog.csdn.net/m0_49256439/article/details/129397019

标签:lib,px2rem,PC,computer,vue3,postcss,vite
From: https://www.cnblogs.com/lzhflzjx/p/17353480.html

相关文章

  • Vue3中slot插槽使用方式
    **********************************Vue3中slot插槽使用方式****************************************************参考:https://huaweicloud.csdn.net/638eab83dacf622b8df8d08c.html<templatev-slot:isFang></template>简写v-slot:isFang#isFang<template#isFan......
  • Vue3---error xx should be on a new line
    ESLint:':render-header'shouldbeonanewline.(vue/max-attributes-per-line)此问题是由于.eslintrc.js文件中的vue/max-attributes-per-line配置错误产生的"vue/max-attributes-per-line":['error',{"singleline":10,......
  • vite + vue3 + vue-router4 + ts + element plus + pinia + axios构建项目
    最后是完整的vite.config.ts、main.ts配置1、先用vite创建一个项目npmcreatevite@latest2、安装elementplusyarnaddelement-plus@element-plus/icons-vuevite.config.ts配置组件按需导入,图标自动导入npminstall-Dunplugin-vue-componentsunplugin-auto-impor......
  • vue3 拖拽操作学习
    AS-Editor组件git:https://gitee.com/was666/as-editor/tree/vue3.x/体验:http://was666.gitee.io/as-editor/#/home......
  • vue3中如何引入element-icon并使用
    简单来说,步骤就是:安装——注册——按需引入——使用安装#NPM$npminstall@element-plus/icons-vue#Yarn$yarnadd@element-plus/icons-vue#pnpm$pnpminstall@element-plus/icons-vue注册您需要从@element-plus/icons-vue中导入所有图标并进行全局注册。......
  • gRPC 应用指引
    一、核心概念、架构及生命周期1、服务定义gRPC默认使用 protocolbuffers。serviceHelloService{rpcSayHello(HelloRequest)returns(HelloResponse);}messageHelloRequest{stringgreeting=1;}messageHelloResponse{stringreply=1;}gR......
  • PCRE库某种情况下如果匹配慢
    如果被匹配的内容超过几十兆字节,pcre2_match()中的倒数第三个参数选用:0 ,就会很慢,如果匹配次数多,就会非常慢。我用一个20兆的文件,匹配90000多个电话号,一天时间都没有匹配结束。但是这个参数如果用了  PCRE2_NO_UTF_CHECK  ,秒完......
  • 热迁移虚拟机报rpc超时
    问题背景:南网生产V区,热迁移虚拟机偶发性失败。问题现象:热迁移虚拟机有时候能成功,有时候直接报错。影响范围:影响热迁移功能问题排查过程:现场反馈源节点7需要做停机整改,所以需要将源节点7上的虚拟机热迁移走。现在迁移成功两台,然后再迁移就报错了。看到nova-compute报错第一时间想到......
  • vue3-sign 手写签名组件
    一个简易签名组件,基于vue3和canvas。#安装npmi@sangtian152/vue3-sign-S#oryarnadd@sangtian152/vue3-sign引入在main.js中写入以下内容:import{createApp}from'vue'importvue3Signfrom'@sangtian152/vue3-sign';import"@sangtian152/vue3-s......
  • vue3+jointjs 使用模板添加元素
    关于如何在Vue3和JointJS中使用拖拽模板来创建节点元素,可以按照以下步骤进行:1.安装JointJS使用npm进行安装:```npminstalljointjs```2.在Vue3中创建JointJS容器在Vue3中创建一个组件,用于创建JointJS的画布和节点。在组件的生命周期方法`mounted`......