20 lines
716 B
TypeScript
20 lines
716 B
TypeScript
import { defineConfig } from 'unocss'
|
||
import presetWeapp from 'unocss-preset-weapp'
|
||
import { extractorAttributify, transformerClass } from 'unocss-preset-weapp/transformer'
|
||
|
||
const { presetWeappAttributify, transformerAttributify } = extractorAttributify()
|
||
|
||
export default defineConfig({
|
||
presets: [
|
||
presetWeapp(), // 小程序预设,默认单位 rpx:w-100 => width:100rpx
|
||
presetWeappAttributify()
|
||
],
|
||
shortcuts: {
|
||
center: 'flex justify-center items-center',
|
||
'btn-primary': 'bg-blue-500 text-white rounded'
|
||
},
|
||
transformers: [
|
||
transformerAttributify(),
|
||
transformerClass() // 解决小程序不支持 \ : [ ] $ 等特殊字符
|
||
]
|
||
}) |