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

[Feature] Added import of SymbolId type from virtual module to improve type safety and development experience #1

Closed
2 tasks done
JakiChen opened this issue Nov 16, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@JakiChen
Copy link
Contributor

JakiChen commented Nov 16, 2024

---
// @ts-ignore
import { file, type SymbolId } from 'virtual:astro-svgs';
export interface Props {
    name: string | SymbolId;
    class?: string;
}

const { name, class: className } = Astro.props;
---
<span class:list={["o-icon", `${className||''}`]}>
    <svg class={`svg-${name}`} xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
        <use xlink:href={`${file}#${name}`} xmlns:xlink="http://www.w3.org/1999/xlink" />
    </svg>
</span>
@JakiChen JakiChen added enhancement New feature or request good first issue Good for newcomers labels Nov 16, 2024
@JakiChen
Copy link
Contributor Author

JakiChen commented Nov 18, 2024

Will be updated in the next version v1.0.2

截屏2024-11-19 00 53 14

JakiChen added a commit that referenced this issue Nov 19, 2024
#1

`virtual:astro-svgs` 模块支持
@JakiChen JakiChen reopened this Nov 19, 2024
JakiChen added a commit that referenced this issue Nov 19, 2024
JakiChen added a commit that referenced this issue Nov 19, 2024
* Update core.ts

- 调整 compose 为普通函数;
- 新增 beautify 标签,以应对开发模式下通过 `http://localhost:4321/@svgs/sprite.svg` 能观察到美化后的 svg 文件,方便观看文件的改动与变化。
- 美化更名为 `formt` 以及相应的代码变更。
- 一些变量的调整

* Update core.ts

* Update plugin.ts

* Update index.ts

* Update helpers.ts

- `md5` 箭头函数
- 美化更名为 `format`,及升级了部分功能

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Create modules.ts

#1

`virtual:astro-svgs` 模块支持

* Update core.ts

- #2 - SVG Standard support ( #3 #4)
- #12 - Subfolder support
- #9 - Message processing: improvement and exploration

* Update index.ts

## issues

#1 #5 #8 #7

* Update helpers.ts

#

* Update core.ts

* Update plugin.ts

* Update core.ts

* Update plugin.ts

#5 #6

* Create index.ts

* Delete icon.ts

* Update index.ts

* Update Icon.astro

* Update build.config.ts

* Update package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant