24 Star 303 Fork 129

h_mo / uniapp-vue3-vite-ts-template

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
unocss.config.js 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
/**
* unocss defineConfig
* @link unocss: https://github.com/unocss/unocss
* @link unocss-preset-weapp: https://github.com/MellowCo/unocss-preset-weapp
* */
import { defineConfig, presetIcons } from 'unocss';
import presetWeapp from 'unocss-preset-weapp';
import { transformerAttributify, transformerClass } from 'unocss-preset-weapp/transformer';
const transformRules = {
'.': '-d111-',
'/': '-s111-',
':': '-c111-',
'%': '-p111-',
'!': '-e111-',
'#': '-w111-',
'(': '-b111l-',
')': '-b111r-',
'[': '-f111l-',
']': '-f111r-',
$: '-r111-',
',': '-r222-',
};
const prefix = `_u_`;
export default defineConfig({
presets: [
// https://github.com/MellowCo/unocss-preset-weapp
presetWeapp({
nonValuedAttribute: true,
prefix: prefix,
whRpx: true,
transform: true,
platform: 'uniapp',
transformRules,
}),
presetIcons({
scale: 1.2,
warn: true,
}),
],
shortcuts: [
{
'border-base': 'border border-gray-500_10',
'_u_z-tar-both': '_u_z-988',
'_u_head-fixed': '_u_fixed _u_top-0 _u_left-0 _u_w-full _u_z-tar-both',
_u_center: '_u_flex _u_justify-center _u_items-center',
},
],
theme: {},
transformers: [
transformerAttributify({
classPrefix: prefix,
transformRules,
nonValuedAttribute: true,
}),
transformerClass({
transformRules,
}),
],
});
1
https://gitee.com/h_mo/uniapp-vue3-vite-ts-template.git
git@gitee.com:h_mo/uniapp-vue3-vite-ts-template.git
h_mo
uniapp-vue3-vite-ts-template
uniapp-vue3-vite-ts-template
master

搜索帮助