vue3-vite2-blog-h5
一款简约版本的移动端博客。前端项目主要是采用Vue3
最新语法糖<script setup>
和Vant3.0
来搭建的;采用Tsx
来渲染公共组件;采用Vite2.0
来构建、打包。后端项目主要采用Node
框架Koa2
以及MongoDB
数据库来设计的。
- PC 端博客线上预览地址:http://www.rasblog.com
- PC 端博客仓库地址:GitHub - Sujb-sus/vue-node-mongodb-blog: vue + node + mongodb + webpack5 + koa2 从开发到上线搭建一款简约的个人博客系统(前后端分离)
- H5 端博客仓库地址:GitHub - Sujb-sus/vue3-vite2-ts-blog-h5: 一款简约版本的移动端博客;主要是采用Vue3最新语法糖<script setup>和Vant3.0来搭建的;采用Tsx来渲染公共组件;采用Vite2.0来构建、打包。
项目预览
项目结构
技术运用
一、rem 适配
- 安装插件
yarn add amfe-flexible postcss-pxtorem -S
amfe-flexible
是配置可伸缩布局方案,主要是将 1 rem 设为 viewWidth / 10postcss-pxtorem
是 postcss 的插件,用于将像素(px)单元生成 rem 单位
- 在 main.ts 导入
amfe-flexible
import "amfe-flexible";
- 在
postcss.config.js
配置postcss-pxtorem
module