From 121cf97230580338214c8aedef6de00cab15f482 Mon Sep 17 00:00:00 2001 From: K <1175047471@qq.com> Date: Tue, 16 Jan 2024 17:00:51 +0800 Subject: [PATCH] chore: add presetAttributify to unocss --- src/types/global.d.ts | 6 ++++++ uno.config.ts | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 763ad1e..2f6eaa3 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -1,5 +1,7 @@ import type { ComponentPublicInstance, ComponentRenderProxy, FunctionalComponent, VNode, VNodeChild, PropType as VuePropType } from 'vue' +import type { AttributifyAttributes } from '@unocss/preset-attributify' + declare global { const __APP_INFO__: { pkg: { @@ -92,3 +94,7 @@ declare global { declare module 'vue' { export type JSXComponent = { new (): ComponentPublicInstance } | FunctionalComponent } + +declare module '@vue/runtime-dom' { + interface HTMLAttributes extends AttributifyAttributes {} +} diff --git a/uno.config.ts b/uno.config.ts index db5d54f..8adaee8 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -1,4 +1,4 @@ -import { defineConfig, presetIcons, presetTypography, presetUno } from 'unocss' +import { defineConfig, presetAttributify, presetIcons, presetTypography, presetUno } from 'unocss' import { getIcons } from './src/components/Icon/src/icons' export default defineConfig({ @@ -12,6 +12,7 @@ export default defineConfig({ 'vertical-align': 'middle', }, }), + presetAttributify(), ], theme: { colors: {