Skip to content

Commit

Permalink
feat: 1. n-img支持设置srcFull大图地址
Browse files Browse the repository at this point in the history
2. 文档支持显示author头像
  • Loading branch information
monako97 committed Aug 9, 2023
1 parent f8be963 commit f8b014f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [2.1.1](https://github.com/monako97/neko-ui/compare/2.0.8...2.1.1) (2023-08-09)
## [2.1.2](https://github.com/monako97/neko-ui/compare/2.0.8...2.1.2) (2023-08-09)

### Bug Fixes

Expand Down
7 changes: 6 additions & 1 deletion components/img/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import { imgCss, style } from './style';
export interface ImgProps {
/** 图片地址 */
src?: string;
/** 查看大图的地址, 默认使用 `src`
* @since 2.1.2
*/
srcFull?: string;
/** 图片 alt */
alt?: string;
/** 大图查看 */
Expand Down Expand Up @@ -128,7 +132,7 @@ function Img(props: ImgProps) {
onClick={portalClick}
>
<span class="close" onClick={close} />
<img class="img" src={props.src} alt={props.alt} />
<img class="img" src={props.srcFull || props.src} alt={props.alt} />
</div>
</Portal>
</Show>
Expand All @@ -140,6 +144,7 @@ customElement(
'n-img',
{
src: void 0,
srcFull: void 0,
alt: void 0,
open: null as boolean | null,
maskClosable: true,
Expand Down
4 changes: 3 additions & 1 deletion components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ const normal = {
export default normal;

/** 组件列表
* @author monako97
* @ignore optional
*/
interface CustomElementTags {
Expand Down Expand Up @@ -245,12 +246,13 @@ interface CustomElementTags {
'n-menu': MenuElement | MenuMultipleElement;
/** Cron表达式编辑器 */
'n-cron': CronElement;
/** 数据表格
/** 日期选择器
* @since 2.1.0
*/
'n-data-picker': DatePickerElement;
/** 数据表格
* @since 2.2.0
* @author monako97 <poi.nyaa@qq.com>
*/
'n-table': TableElement;
}
Expand Down
16 changes: 13 additions & 3 deletions components/md/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,16 @@ export const style = css`
text-shadow: 0 1px var(--primary-shadow);
}
.n-md-toc li a[href^='http']::after,
.n-md-toc li a[href^='\/\/']::after {
.n-md-toc a[href^='http']::after,
.n-md-toc a[href^='\/\/']::after,
.n-md-body table a[href^='http']::after {
content: ' ⎋';
opacity: 0.5;
opacity: 0.3;
}
a[href^='mailto:']::after {
content: ' 📧';
opacity: 0.4;
}
a[href]::before {
Expand All @@ -163,6 +169,10 @@ export const style = css`
content: '';
}
a[href]:has(img, n-img)::before {
content: none !important;
}
a:hover::before {
transform: scaleX(1);
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neko-ui",
"version": "2.1.1",
"version": "2.1.2",
"description": "Web Components UI Libraries",
"main": "lib/index.js",
"scripts": {
Expand Down Expand Up @@ -36,7 +36,7 @@
"@commitlint/config-conventional": "17.6.6",
"@moneko/cli": "2.0.0-beta.5",
"@moneko/common": "1.2.0",
"@moneko/core": "3.0.0-beta.100",
"@moneko/core": "3.0.0-beta.101",
"@moneko/css": "1.0.5",
"@moneko/postcss": "1.0.30",
"@moneko/solid-js": "1.1.8",
Expand Down

0 comments on commit f8b014f

Please sign in to comment.