新增unocss,暂未启用

unocss
chris 7 months ago
parent 704b8ed0d0
commit 6ec0a5d5b1

@ -1,6 +1,7 @@
import App from './App' import App from './App'
import '@/assets/styles/main.scss' import '@/assets/styles/main.scss'
import '@/uni_modules/uni-scss/theme-custom.scss' import '@/uni_modules/uni-scss/theme-custom.scss'
// import 'virtual:uno.css'
// #ifdef APP-VUE // #ifdef APP-VUE
plus.screen.lockOrientation('landscape-primary'); 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": "smart_campus",
"name": "Android、ios、小程序等ble蓝牙小票、标签、面单打印插件", "version": "1.0.0",
"displayName": "Android、ios、小程序等ble蓝牙小票、标签、面单打印插件", "description": "",
"version": "1.02", "main": "main.js",
"description": "蓝牙打印参考示例支持vue3小程序、APP安卓ios可以对不同型号打印机的指令发送即可打印理论上任何打印机的指令都可以在例子中运行demo附含指令文档手册自行查询。", "dependencies": {
"keywords": [ "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",
"dcloudext": { "postcss-pxtorpx-pro": "^2.0.0",
"category": [ "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 postcssCfg from './postcss.config.js'
import VueSetupExtend from 'vite-plugin-vue-setup-extend'; import VueSetupExtend from 'vite-plugin-vue-setup-extend';
import h5ProdEffectPlugin from 'uni-vite-plugin-h5-prod-effect'; import h5ProdEffectPlugin from 'uni-vite-plugin-h5-prod-effect';
// import UnoCSS from 'unocss/vite'
export default defineConfig({ export default defineConfig({
plugins: [uni(), VueSetupExtend(), h5ProdEffectPlugin()], plugins: [
uni(),
VueSetupExtend(),
h5ProdEffectPlugin(),
// UnoCSS()
],
css: { css: {
preprocessorOptions: { preprocessorOptions: {
scss: { scss: {

Loading…
Cancel
Save