Files
element-plus/docs/examples/config-provider/link.vue
snowbitx 0db1ae698c refactor(components): [config-provider] improve ConfigContext types (#23528)
* refactor(components): [config-provider] align shadow type

* refactor(components): [config-provider] align button/link  context type

* Update button.vue

* Change link type from 'primary' to 'success'
2026-01-26 10:35:38 +08:00

41 lines
1.0 KiB
Vue

<template>
<div>
<div class="flex gap-4">
<div class="flex flex-col basis-150px gap-1">
<span>Type:</span>
<el-select v-model="config.type">
<el-option v-for="type in linkTypes" :key="type" :value="type" />
</el-select>
</div>
<div class="flex flex-col basis-150px gap-1">
<span>Underline:</span>
<el-select v-model="config.underline">
<el-option
v-for="type in underlineOptions"
:key="type"
:value="type"
/>
</el-select>
</div>
</div>
<el-divider />
<el-config-provider :link="config">
<el-link>Link desu!</el-link>
</el-config-provider>
</div>
</template>
<script lang="ts" setup>
import { reactive } from 'vue'
import type { LinkConfigContext } from 'element-plus'
const linkTypes = ['primary', 'success', 'warning', 'info', 'danger', 'default']
const underlineOptions = ['always', 'never', 'hover']
const config = reactive<LinkConfigContext>({
type: 'success',
underline: 'always',
})
</script>