import {defineConfig, presetUno, presetIcons, presetAttributify} from 'unocss' import {presetExtra} from 'unocss-preset-extra'; import presetWeapp from 'unocss-preset-weapp' import {transformerAttributify, transformerClass} from 'unocss-preset-weapp/transformer' export default defineConfig({ shortcuts: { 'hc-flex': 'relative flex items-center', 'hc-flex-center': 'hc-flex justify-center', 'hc-flex-end': 'hc-flex justify-end', 'hc-p': 'px-3 py-2', 'hc-tr': 'absolute top-0 right-0', }, presets: [ presetUno(), presetWeapp(), presetIcons({ //autoInstall: true, //自动安装图标库 }), presetAttributify({ prefix: 'un-', //属性冲突的自定义前缀 prefixedOnly: true, //强制使用前缀 }), //其它扩展,主要用动画,集成了 animate.css presetExtra(), ], transformers: [ transformerAttributify(), transformerClass(), ] })