新增unocss,暂未启用

unocss
chris 7 months ago
parent 704b8ed0d0
commit 6ec0a5d5b1

@ -1,6 +1,7 @@
import App from './App'
import '@/assets/styles/main.scss'
import '@/uni_modules/uni-scss/theme-custom.scss'
// import 'virtual:uno.css'
// #ifdef APP-VUE
plus.screen.lockOrientation('landscape-primary');

4205
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,20 +1,24 @@
{
"id": "wangqingzhou311-bleBlueTooth",
"name": "Android、ios、小程序等ble蓝牙小票、标签、面单打印插件",
"displayName": "Android、ios、小程序等ble蓝牙小票、标签、面单打印插件",
"version": "1.02",
"description": "蓝牙打印参考示例支持vue3小程序、APP安卓ios可以对不同型号打印机的指令发送即可打印理论上任何打印机的指令都可以在例子中运行demo附含指令文档手册自行查询。",
"keywords": [
"蓝牙打印",
"二维码打印",
"小票打印",
"标签打印",
"打印指令"
],
"dcloudext": {
"category": [
"前端组件",
"通用组件"
]
}
}
"name": "smart_campus",
"version": "1.0.0",
"description": "",
"main": "main.js",
"dependencies": {
"js-cookie": "^3.0.5",
"js-tokens": "^4.0.0",
"uni-crazy-router": "^1.1.3",
"vite": "^5.1.4"
},
"devDependencies": {
"postcss": "^8.4.38",
"postcss-pxtorpx-pro": "^2.0.0",
"uni-vite-plugin-h5-prod-effect": "^1.0.1",
"unocss": "^0.59.4",
"vite-plugin-vue-setup-extend": "^0.4.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "chris",
"license": "ISC"
}

@ -0,0 +1,13 @@
import { defineConfig } from "unocss";
const rules = [
[/^mg-([\.\d]+)$/, ([_, num]) => ({ margin: `${num}px` })],
[/^mg-t-([\.\d]+)$/, ([_, num]) => ({ marginTop: `${num}px` })],
[/^mg-b-([\.\d]+)$/, ([_, num]) => ({ marginBottom: `${num}px` })],
[/^mg-r-([\.\d]+)$/, ([_, num]) => ({ marginRight: `${num}px` })],
[/^mg-l-([\.\d]+)$/, ([_, num]) => ({ marginLeft: `${num}px` })]
]
export default defineConfig({
rules,
})

@ -3,9 +3,15 @@ import uni from '@dcloudio/vite-plugin-uni';
import postcssCfg from './postcss.config.js'
import VueSetupExtend from 'vite-plugin-vue-setup-extend';
import h5ProdEffectPlugin from 'uni-vite-plugin-h5-prod-effect';
// import UnoCSS from 'unocss/vite'
export default defineConfig({
plugins: [uni(), VueSetupExtend(), h5ProdEffectPlugin()],
plugins: [
uni(),
VueSetupExtend(),
h5ProdEffectPlugin(),
// UnoCSS()
],
css: {
preprocessorOptions: {
scss: {

Loading…
Cancel
Save