mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
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:
parent
ad3d998752
commit
5d2daca248
@ -2,7 +2,7 @@
|
|||||||
name: 'el-button'
|
name: 'el-button'
|
||||||
type: 'props'
|
type: 'props'
|
||||||
version: '2.2.1'
|
version: '2.2.1'
|
||||||
commit_hash: '4a364f9'
|
commit_hash: 'ad3d998'
|
||||||
description: |
|
description: |
|
||||||
Per [Link Button Request](https://github.com/element-plus/element-plus/issues/7610), we need to
|
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.
|
add a `link` like button back for those uses link button.
|
||||||
|
@ -19,8 +19,8 @@ const onSwitchLang = (lang: string) => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="full-screen-translation">
|
<div class="full-screen-translation">
|
||||||
<ElButton
|
<ElButton
|
||||||
type="text"
|
|
||||||
style="width: 100%; color: var(--text-color)"
|
style="width: 100%; color: var(--text-color)"
|
||||||
|
text
|
||||||
@click="toggle"
|
@click="toggle"
|
||||||
>
|
>
|
||||||
<div class="translation-toggler">
|
<div class="translation-toggler">
|
||||||
|
@ -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
|
## Text Button
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<p>Basic link button</p>
|
<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
|
<el-button
|
||||||
v-for="button in buttons"
|
v-for="button in buttons"
|
||||||
:key="button.text"
|
:key="button.text"
|
||||||
@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>Disabled link button</p>
|
<p>Disabled link button</p>
|
||||||
<div class="flex justify-space-between">
|
<div class="flex justify-space-between flex-wrap gap-4">
|
||||||
<el-button
|
<el-button
|
||||||
v-for="button in buttons"
|
v-for="button in buttons"
|
||||||
:key="button.text"
|
:key="button.text"
|
||||||
@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{ type: 'link', text: 'link' },
|
|
||||||
{ type: '', text: 'plain' },
|
{ type: '', text: 'plain' },
|
||||||
{ type: 'primary', text: 'primary' },
|
{ type: 'primary', text: 'primary' },
|
||||||
{ type: 'success', text: 'success' },
|
{ type: 'success', text: 'success' },
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<p>Basic text button</p>
|
<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
|
<el-button
|
||||||
v-for="button in buttons"
|
v-for="button in buttons"
|
||||||
:key="button.text"
|
:key="button.text"
|
||||||
@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>Background color always on</p>
|
<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
|
<el-button
|
||||||
v-for="button in buttons"
|
v-for="button in buttons"
|
||||||
:key="button.text"
|
:key="button.text"
|
||||||
@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>Disabled text button</p>
|
<p>Disabled text button</p>
|
||||||
<div class="flex justify-space-between">
|
<div class="flex justify-space-between flex-wrap gap-4">
|
||||||
<el-button
|
<el-button
|
||||||
v-for="button in buttons"
|
v-for="button in buttons"
|
||||||
:key="button.text"
|
:key="button.text"
|
||||||
@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{ type: 'link', text: 'link' },
|
|
||||||
{ type: '', text: 'plain' },
|
{ type: '', text: 'plain' },
|
||||||
{ type: 'primary', text: 'primary' },
|
{ type: 'primary', text: 'primary' },
|
||||||
{ type: 'success', text: 'success' },
|
{ type: 'success', text: 'success' },
|
||||||
|
@ -198,6 +198,10 @@ $button-icon-span-gap: map.merge(
|
|||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: getCssVar('button', 'hover', 'link-text-color');
|
||||||
|
}
|
||||||
|
|
||||||
@include when(disabled) {
|
@include when(disabled) {
|
||||||
color: getCssVar('button', 'disabled', 'text-color');
|
color: getCssVar('button', 'disabled', 'text-color');
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
|
@ -83,6 +83,11 @@
|
|||||||
'color',
|
'color',
|
||||||
'white',
|
'white',
|
||||||
),
|
),
|
||||||
|
'link-text-color': (
|
||||||
|
'color',
|
||||||
|
$type,
|
||||||
|
'light-5',
|
||||||
|
),
|
||||||
'bg-color': (
|
'bg-color': (
|
||||||
'color',
|
'color',
|
||||||
$type,
|
$type,
|
||||||
|
Loading…
Reference in New Issue
Block a user