Skip to content

Commit f9c07dc

Browse files
CrazyOrrbetavs
andauthored
fix(link): disabled style condition judgment is missing (#3643)
* fix link's condition for disabled style * fix(link): simplify condition for disabled class --------- Co-authored-by: betavs <betavs@qq.com>
1 parent c66b7bf commit f9c07dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/link/link.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ export default class Link extends SuperComponent {
5555
setClass() {
5656
const { theme, size, underline, navigatorProps, disabled } = this.properties;
5757
const classList = [name, `${name}--${theme}`, `${name}--${size}`];
58+
const { url, appId, shortLink, target, openType } = navigatorProps ?? {};
59+
const condition = !(url || (target === 'miniProgram' && (appId || shortLink)));
60+
5861
if (underline) {
5962
classList.push(`${name}--underline`);
6063
}
61-
if (
62-
(navigatorProps && !navigatorProps.url && !['navigateBack', 'exit'].includes(navigatorProps.openType)) ||
63-
disabled
64-
) {
64+
if ((navigatorProps && condition && !['navigateBack', 'exit'].includes(openType)) || disabled) {
6565
classList.push(`${name}--disabled`);
6666
}
6767

0 commit comments

Comments
 (0)