docs(components): [button] link button (#7694)

- Update docs for link button.
- Update vp-translation wrong usage of button.
- Update doc show cases examples.
- Update commit hash value for `link button`
This commit is contained in:
JeremyWuuuuu 2022-05-14 12:58:09 +08:00 committed by GitHub
parent ad3d998752
commit 5d2daca248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 9 deletions

View File

@ -2,7 +2,7 @@
name: 'el-button'
type: 'props'
version: '2.2.1'
commit_hash: '4a364f9'
commit_hash: 'ad3d998'
description: |
Per [Link Button Request](https://github.com/element-plus/element-plus/issues/7610), we need to
add a `link` like button back for those uses link button.

View File

@ -19,8 +19,8 @@ const onSwitchLang = (lang: string) => {
<template>
<div class="full-screen-translation">
<ElButton
type="text"
style="width: 100%; color: var(--text-color)"
text
@click="toggle"
>
<div class="translation-toggler">

View File

@ -25,6 +25,17 @@ button/disabled
:::
## Link Button <VersionTag version="2.2.1" />
Since the last version, we deleted `type="link"` which was not really a smooth transition, so we added back `Link Button`,
for some users `Link Button` is the suitable choice. Notably we would suggest using `Link` component to be more accessible.
:::demo
button/link
:::
## Text Button
:::tip

View File

@ -1,6 +1,6 @@
<template>
<p>Basic link button</p>
<div class="flex justify-space-between mb-4">
<div class="flex justify-space-between mb-4 flex-wrap gap-4">
<el-button
v-for="button in buttons"
:key="button.text"
@ -11,7 +11,7 @@
</div>
<p>Disabled link button</p>
<div class="flex justify-space-between">
<div class="flex justify-space-between flex-wrap gap-4">
<el-button
v-for="button in buttons"
:key="button.text"
@ -25,7 +25,6 @@
<script setup lang="ts">
const buttons = [
{ type: 'link', text: 'link' },
{ type: '', text: 'plain' },
{ type: 'primary', text: 'primary' },
{ type: 'success', text: 'success' },

View File

@ -1,6 +1,6 @@
<template>
<p>Basic text button</p>
<div class="flex justify-space-between mb-4">
<div class="flex justify-space-between mb-4 flex-wrap gap-4">
<el-button
v-for="button in buttons"
:key="button.text"
@ -11,7 +11,7 @@
</div>
<p>Background color always on</p>
<div class="flex justify-space-between mb-4">
<div class="flex justify-space-between mb-4 flex-wrap gap-4">
<el-button
v-for="button in buttons"
:key="button.text"
@ -23,7 +23,7 @@
</div>
<p>Disabled text button</p>
<div class="flex justify-space-between">
<div class="flex justify-space-between flex-wrap gap-4">
<el-button
v-for="button in buttons"
:key="button.text"
@ -37,7 +37,6 @@
<script setup lang="ts">
const buttons = [
{ type: 'link', text: 'link' },
{ type: '', text: 'plain' },
{ type: 'primary', text: 'primary' },
{ type: 'success', text: 'success' },

View File

@ -198,6 +198,10 @@ $button-icon-span-gap: map.merge(
padding-left: 0;
padding-right: 0;
&:hover {
color: getCssVar('button', 'hover', 'link-text-color');
}
@include when(disabled) {
color: getCssVar('button', 'disabled', 'text-color');
background-color: transparent !important;

View File

@ -83,6 +83,11 @@
'color',
'white',
),
'link-text-color': (
'color',
$type,
'light-5',
),
'bg-color': (
'color',
$type,