Skip to content

Commit

Permalink
Merge pull request #799 from GuYith/master
Browse files Browse the repository at this point in the history
fix: link class
  • Loading branch information
dntzhang authored Aug 21, 2023
2 parents 9d8670d + 23335c0 commit 5d94c9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tdesign/desktop/src/link/link.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { h, tag, extractClass, WeElement, OmiProps } from 'omi'
import { h, tag, classNames, WeElement, OmiProps } from 'omi'
import { LinkProps } from './type'
import parseTNode from '../utils/parseTNode'
import css from './style/index'
Expand Down Expand Up @@ -37,7 +37,7 @@ export default class Link extends WeElement<LinkProps> {
const classPrefix = 't'

const childNode = props.content || props.children
const linkClass = extractClass(`${classPrefix}-link`, `${classPrefix}-link--theme-${props.theme}`, {
const linkClass = classNames(`${classPrefix}-link`, `${classPrefix}-link--theme-${props.theme}`, {
[`${classPrefix}-size-s`]: props.size === 'small',
[`${classPrefix}-size-l`]: props.size === 'large',
[`${classPrefix}-is-disabled`]: !!props.disabled,
Expand All @@ -48,7 +48,7 @@ export default class Link extends WeElement<LinkProps> {
return (
<>
<a
{...linkClass}
class={linkClass}
href={props.disabled || !props.href ? undefined : props.href}
target={props.target}
onClick={this.handleClick}
Expand Down

0 comments on commit 5d94c9c

Please sign in to comment.