u
This commit is contained in:
1 parent
f572dce2f6
commit
e99a9fb274
356 files changed
+28877
-1055
No files matched your search
@@ -0,0 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
// 全局默认值:显式 prop > componentDefaults > 组件内置默认
|
||||
import { G3Button, G3ConfigProvider, G3Space } from '@g3soft/ui'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<G3Space direction="vertical" :size="12" style="display: flex">
|
||||
<!-- 默认:primary / medium -->
|
||||
<G3Space :size="8">
|
||||
<G3Button>默认变体</G3Button>
|
||||
</G3Space>
|
||||
|
||||
<!-- 子树内所有按钮默认变成 outline / small,显式传 type 仍然优先 -->
|
||||
<G3ConfigProvider :component-defaults="{ button: { type: 'outline', size: 'small' } }">
|
||||
<G3Space :size="8" align="center">
|
||||
<G3Button>继承全局默认</G3Button>
|
||||
<G3Button type="primary" size="large">显式 prop 优先</G3Button>
|
||||
</G3Space>
|
||||
</G3ConfigProvider>
|
||||
</G3Space>
|
||||
</template>
|
||||
Reference in new issue
Block a user