22 lines
775 B
Vue
22 lines
775 B
Vue
<script setup lang="ts">
|
||
// 全局默认值:显式 prop > componentDefaults > 组件内置默认
|
||
import { G3Button, G3ConfigProvider, G3Space } from '@g3soft/ui'
|
||
</script>
|
||
|
||
<template>
|
||
<G3Space 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>
|