uni-helper / unocss-preset-uni

专为 uni-app 打造的 UnoCSS 预设
MIT License
73 stars 6 forks source link

给组件props传递色彩值时,丢失了 #31

Closed hewx815 closed 1 month ago

hewx815 commented 1 month ago

描述问题

给组件props传递色彩值时,丢失了 传递给 的color属性,在组件内输出到控制台

复现

image image image

我的配置

import {
  defineConfig,
  presetIcons,
  transformerDirectives,
  transformerVariantGroup,
} from 'unocss'

import { presetUni } from '@uni-helper/unocss-preset-uni'
export default defineConfig({
  presets: [
    presetUni(),
    presetIcons({
      scale: 1.2,
      warn: true,
      extraProperties: {
        'display': 'inline-block',
        'vertical-align': 'middle',
      },
    }),
  ],
  transformers: [
    transformerDirectives(),
    transformerVariantGroup(),
  ],
  rules: [
    ['flex-center', {
      'display': 'flex',
      'align-items': 'center',
      'justify-content': 'center',
    }],
    ['absolute-center', {
      position: 'absolute',
      top: '50%',
      left: '50%',
      transform: 'translate(-50%, -50%)',
    }],
    [/^radius-(.+)$/, ([, d]) => ({ 'border-radius': d })],
    [/^fs-(.+)$/, ([, d]) => ({ 'font-size': d })],
    ['bd', { border: '1px solid #000' }],
    [/^bd-(.+)$/, ([, d]) => ({ border: `1px solid ${d}` })],
  ],
})

系统信息

设备:MacBook Pro , Mac14,7 编译平台:微信小程序 uniapp 版本:3.0.0-4020420240722002 uni-ui 版本:1.5.6

使用的包管理器

pnpm

核对

贡献

ModyQyW commented 1 month ago

https://github.com/uni-helper/unocss-preset-uni/issues/30