Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(link): fix demo slot usage #4417

Merged
merged 2 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/link/_example-ts/disabled.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<t-link theme="danger" hover="color" disabled @click="clickLink"> 跳转链接 </t-link>
<t-link theme="warning" hover="underline" disabled :on-click="clickLink"> 跳转链接 </t-link>
<t-link theme="success" disabled @click="clickLink">
<jump-icon slot="suffixIcon" />
<template #suffixIcon>
<jump-icon />
</template>
跳转链接
</t-link>
</t-space>
Expand Down
8 changes: 6 additions & 2 deletions src/link/_example-ts/icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
<t-space>
<t-link theme="default" :prefix-icon="renderPrefixIcon" :on-click="clickLink"> 跳转链接 </t-link>
<t-link theme="primary" underline href="https://tdesign.tencent.com/" target="_self">
<link-icon slot="prefix-icon"></link-icon>
<template #prefix-icon>
<link-icon />
</template>
跳转链接
</t-link>
<t-link theme="danger" hover="color" href="https://tdesign.tencent.com/" target="_blank" @click="clickLink">
<jump-icon slot="suffixIcon" />
<template #suffix-icon>
<jump-icon />
</template>
跳转链接
</t-link>
<t-link theme="warning" :suffix-icon="renderSuffixIcon" disabled> 跳转链接 </t-link>
Expand Down
4 changes: 3 additions & 1 deletion src/link/_example/disabled.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<t-link theme="danger" hover="color" disabled @click="clickLink"> 跳转链接 </t-link>
<t-link theme="warning" hover="underline" disabled :on-click="clickLink"> 跳转链接 </t-link>
<t-link theme="success" disabled @click="clickLink">
<jump-icon slot="suffixIcon" />
<template #suffixIcon>
<jump-icon />
</template>
跳转链接
</t-link>
</t-space>
Expand Down
8 changes: 6 additions & 2 deletions src/link/_example/icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
<t-space>
<t-link theme="default" :prefix-icon="renderPrefixIcon" :on-click="clickLink"> 跳转链接 </t-link>
<t-link theme="primary" underline href="https://tdesign.tencent.com/" target="_self">
<link-icon slot="prefix-icon"></link-icon>
<template #prefix-icon>
<link-icon />
</template>
跳转链接
</t-link>
<t-link theme="danger" hover="color" href="https://tdesign.tencent.com/" target="_blank" @click="clickLink">
<jump-icon slot="suffixIcon" />
<template #suffix-icon>
<jump-icon />
</template>
跳转链接
</t-link>
<t-link theme="warning" :suffix-icon="renderSuffixIcon" disabled> 跳转链接 </t-link>
Expand Down
96 changes: 54 additions & 42 deletions test/unit/snap/__snapshots__/csr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -83235,22 +83235,26 @@ exports[`csr snapshot test > csr test ./src/link/_example/disabled.vue 1`] = `
>
<!---->

<svg
class="t-icon t-icon-jump"
fill="none"
height="1em"
slot="suffixIcon"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M3 21V3h7.1v2H5v14h14v-5.1h2V21H3zm7.59-9l7-7H13V3h8v8h-2V6.41l-7 7L10.59 12z"
fill="currentColor"
/>
</svg>
跳转链接

<!---->
<span
class="t-link__suffix-icon"
>

<svg
class="t-icon t-icon-jump"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M3 21V3h7.1v2H5v14h14v-5.1h2V21H3zm7.59-9l7-7H13V3h8v8h-2V6.41l-7 7L10.59 12z"
fill="currentColor"
/>
</svg>

</span>
</a>
</div>
<!---->
Expand Down Expand Up @@ -83642,21 +83646,25 @@ exports[`csr snapshot test > csr test ./src/link/_example/icon.vue 1`] = `
href="https://tdesign.tencent.com/"
target="_self"
>
<!---->

<svg
class="t-icon t-icon-link"
fill="none"
height="1em"
slot="prefix-icon"
viewBox="0 0 24 24"
width="1em"
<span
class="t-link__prefix-icon"
>
<path
d="M13.3 3.96a4.77 4.77 0 116.74 6.75l-3.03 3.03-1.41-1.42 3.03-3.03a2.77 2.77 0 10-3.92-3.92L11.68 8.4 10.26 7l3.03-3.03zM15.4 10L10 15.41 8.58 14 14 8.59 15.4 10zm-7 1.68L5.36 14.7a2.77 2.77 0 103.92 3.92l3.03-3.03L13.74 17l-3.03 3.03a4.77 4.77 0 11-6.75-6.75l3.03-3.03 1.41 1.42z"
fill="currentColor"
/>
</svg>

<svg
class="t-icon t-icon-link"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M13.3 3.96a4.77 4.77 0 116.74 6.75l-3.03 3.03-1.41-1.42 3.03-3.03a2.77 2.77 0 10-3.92-3.92L11.68 8.4 10.26 7l3.03-3.03zM15.4 10L10 15.41 8.58 14 14 8.59 15.4 10zm-7 1.68L5.36 14.7a2.77 2.77 0 103.92 3.92l3.03-3.03L13.74 17l-3.03 3.03a4.77 4.77 0 11-6.75-6.75l3.03-3.03 1.41 1.42z"
fill="currentColor"
/>
</svg>

</span>

跳转链接

<!---->
Expand All @@ -83675,22 +83683,26 @@ exports[`csr snapshot test > csr test ./src/link/_example/icon.vue 1`] = `
>
<!---->

<svg
class="t-icon t-icon-jump"
fill="none"
height="1em"
slot="suffixIcon"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M3 21V3h7.1v2H5v14h14v-5.1h2V21H3zm7.59-9l7-7H13V3h8v8h-2V6.41l-7 7L10.59 12z"
fill="currentColor"
/>
</svg>
跳转链接

<!---->
<span
class="t-link__suffix-icon"
>

<svg
class="t-icon t-icon-jump"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M3 21V3h7.1v2H5v14h14v-5.1h2V21H3zm7.59-9l7-7H13V3h8v8h-2V6.41l-7 7L10.59 12z"
fill="currentColor"
/>
</svg>

</span>
</a>
</div>
<!---->
Expand Down
Loading
Loading