Skip to content

Commit

Permalink
fix(admin/components/button): LinkButton 在禁用状态下不再可点击
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Sep 17, 2024
1 parent cd7b3d3 commit 501db82
Show file tree
Hide file tree
Showing 5 changed files with 370 additions and 112 deletions.
12 changes: 6 additions & 6 deletions admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,26 @@
"dependencies": {
"@formatjs/intl-localematcher": "^0.5.4",
"@solid-primitives/i18n": "^2.1.1",
"@solidjs/router": "^0.14.3",
"@solidjs/router": "^0.14.5",
"localforage": "^1.10.0",
"material-symbols": "^0.23.0",
"quill": "^2.0.2",
"solid-js": "^1.8.22",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
},
"devDependencies": {
"@types/node": "^22.5.4",
"@vitest/coverage-v8": "^2.0.5",
"@types/node": "^22.5.5",
"@vitest/coverage-v8": "^2.1.1",
"autoprefixer": "^10.4.20",
"cssnano": "^7.0.6",
"jsdom": "^25.0.0",
"postcss": "^8.4.45",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.11",
"typescript": "^5.6.2",
"vite": "^5.4.4",
"vite": "^5.4.6",
"vite-plugin-dts": "^4.2.1",
"vite-plugin-solid": "^2.10.2",
"vitest": "^2.0.5",
"vitest": "^2.1.1",
"vitest-fetch-mock": "^0.3.0"
}
}
4 changes: 3 additions & 1 deletion admin/src/components/button/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export default function(props: Props) {
props = mergeProps(defaultProps, props);

// A.href 无法设置为 javascript:void(0)
return <A href={props.disabled ? '' : props.href} accessKey={props.accessKey} title={props.title} classList={{
return <A href={props.href} accessKey={props.accessKey} title={props.title} onClick={
!props.disabled ? undefined : e => e.preventDefault()
} classList={{
'c--button': true,
'c--icon-container': true,
'c--icon': props.icon,
Expand Down
8 changes: 4 additions & 4 deletions cmd/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
"preview": "vite preview"
},
"dependencies": {
"@solidjs/router": "^0.14.3",
"@solidjs/router": "^0.14.5",
"admin": "0.7.0",
"solid-js": "^1.8.22"
},
"devDependencies": {
"@types/node": "^22.5.4",
"@types/node": "^22.5.5",
"@vitejs/plugin-basic-ssl": "^1.1.0",
"autoprefixer": "^10.4.20",
"cssnano": "^7.0.6",
"postcss": "^8.4.45",
"postcss": "^8.4.47",
"solid-devtools": "^0.30.1",
"tailwindcss": "^3.4.11",
"typescript": "^5.6.2",
"vite": "^5.4.4",
"vite": "^5.4.6",
"vite-plugin-solid": "^2.10.2"
}
}
Loading

0 comments on commit 501db82

Please sign in to comment.