feat: 初始化工程
This commit is contained in:
20
unocss.config.ts
Normal file
20
unocss.config.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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() // 解决小程序不支持 \ : [ ] $ 等特殊字符
|
||||
]
|
||||
})
|
||||
Reference in New Issue
Block a user