fix: 添加 StyleProvider 以支持 Tailwind 样式覆盖;移除 InputNumber 组件的宽度样式,优化组件适配;antdv 暂不支持
This commit is contained in:
@@ -726,9 +726,7 @@ async function initComponentAdapter() {
|
||||
modelValueProp: 'value',
|
||||
}),
|
||||
Input: withDefaultPlaceholder(Input, 'input'),
|
||||
InputNumber: withDefaultPlaceholder(InputNumber, 'input', {
|
||||
style: { width: '100%' },
|
||||
}),
|
||||
InputNumber: withDefaultPlaceholder(InputNumber, 'input'),
|
||||
InputPassword: withDefaultPlaceholder(InputPassword, 'input'),
|
||||
Mentions: withDefaultPlaceholder(Mentions, 'input'),
|
||||
// 自定义主要按钮
|
||||
|
||||
@@ -4,7 +4,7 @@ import { computed, watch } from 'vue';
|
||||
import { useAntdDesignTokens } from '@vben/hooks';
|
||||
import { preferences, usePreferences } from '@vben/preferences';
|
||||
|
||||
import { App, ConfigProvider, theme } from 'antdv-next';
|
||||
import { App, ConfigProvider, StyleProvider, theme } from 'antdv-next';
|
||||
|
||||
import { antdLocale } from '#/locales';
|
||||
|
||||
@@ -39,9 +39,12 @@ watch(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ConfigProvider :locale="antdLocale" :theme="tokenTheme">
|
||||
<App>
|
||||
<RouterView />
|
||||
</App>
|
||||
</ConfigProvider>
|
||||
<!-- layer: antd 组件样式注入 @layer antd,让 Tailwind 工具类可以覆盖组件样式 -->
|
||||
<StyleProvider layer>
|
||||
<ConfigProvider :locale="antdLocale" :theme="tokenTheme">
|
||||
<App>
|
||||
<RouterView />
|
||||
</App>
|
||||
</ConfigProvider>
|
||||
</StyleProvider>
|
||||
</template>
|
||||
|
||||
@@ -284,9 +284,7 @@ async function initComponentAdapter() {
|
||||
inputComponent: ElInput,
|
||||
}),
|
||||
Input: withDefaultPlaceholder(ElInput, 'input'),
|
||||
InputNumber: withDefaultPlaceholder(ElInputNumber, 'input', {
|
||||
style: { width: '100%' },
|
||||
}),
|
||||
InputNumber: withDefaultPlaceholder(ElInputNumber, 'input'),
|
||||
RadioGroup: (props, { attrs, slots }) => {
|
||||
let defaultSlot;
|
||||
if (Reflect.has(slots, 'default')) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineConfig } from '@vben/vite-config';
|
||||
import { defineConfig, viteCssLayerPlugin } from '@vben/vite-config';
|
||||
|
||||
import ElementPlus from 'unplugin-element-plus/vite';
|
||||
|
||||
@@ -7,9 +7,9 @@ export default defineConfig(async () => {
|
||||
application: {},
|
||||
vite: {
|
||||
plugins: [
|
||||
ElementPlus({
|
||||
format: 'esm',
|
||||
}),
|
||||
// element-plus 的 css 包进 @layer el,使 Tailwind 工具类可覆盖组件样式
|
||||
viteCssLayerPlugin({ layerName: 'el', packageName: 'element-plus' }),
|
||||
ElementPlus({ format: 'esm' }),
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
|
||||
@@ -225,9 +225,7 @@ async function initComponentAdapter() {
|
||||
inputComponent: NInput,
|
||||
}),
|
||||
Input: withDefaultPlaceholder(NInput, 'input'),
|
||||
InputNumber: withDefaultPlaceholder(NInputNumber, 'input', {
|
||||
style: { width: '100%' },
|
||||
}),
|
||||
InputNumber: withDefaultPlaceholder(NInputNumber, 'input'),
|
||||
RadioGroup: (props, { attrs, slots }) => {
|
||||
let defaultSlot;
|
||||
if (Reflect.has(slots, 'default')) {
|
||||
|
||||
@@ -239,9 +239,7 @@ async function initComponentAdapter() {
|
||||
modelValueProp: 'value',
|
||||
}),
|
||||
Input: withDefaultPlaceholder(Input, 'input'),
|
||||
InputNumber: withDefaultPlaceholder(InputNumber, 'input', {
|
||||
style: { width: '100%' },
|
||||
}),
|
||||
InputNumber: withDefaultPlaceholder(InputNumber, 'input'),
|
||||
// InputPassword: withDefaultPlaceholder(InputPassword, 'input'),
|
||||
// Mentions: withDefaultPlaceholder(Mentions, 'input'),
|
||||
// 自定义主要按钮
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import { defineConfig } from '@vben/vite-config';
|
||||
import { defineConfig, viteCssLayerPlugin } from '@vben/vite-config';
|
||||
|
||||
export default defineConfig(async () => {
|
||||
return {
|
||||
application: {},
|
||||
vite: {
|
||||
plugins: [
|
||||
// tdesign 的 css 包进 @layer td,使 Tailwind 工具类可覆盖组件样式
|
||||
viteCssLayerPlugin({
|
||||
layerName: 'td',
|
||||
packageName: 'tdesign-vue-next',
|
||||
}),
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
|
||||
Reference in New Issue
Block a user