diff --git a/devui/icon/src/icon.tsx b/devui/icon/src/icon.tsx index cecee9f591f2c4c3759a9fe777b6c211e08d902b..16e4593648a231e06a6a0f133fde0f30d57e70b9 100644 --- a/devui/icon/src/icon.tsx +++ b/devui/icon/src/icon.tsx @@ -29,10 +29,18 @@ export default defineComponent({ const { name, size, color, classPrefix } = this return ( - + <> + { + /^((https?):)?\/\//.test(name) + ? {name.split('/')[name.split('/').length + : + } + ) } }) \ No newline at end of file diff --git a/docs/components/icon/index.md b/docs/components/icon/index.md index 45ba44f2b93de66f0e75a3ed297b9905dc985c3b..12e1d4b6532389d335104ba3722004392bcd1a48 100644 --- a/docs/components/icon/index.md +++ b/docs/components/icon/index.md @@ -12,18 +12,37 @@ ### 基本用法 - - - - +:::demo 通过`name`属性,指定需要显示的图标。 -```html - - - - +```vue + + +``` + +::: + +### 图标颜色 + +:::demo 通过`color`属性指定图标的颜色。 + +```vue + + ``` +::: + +### 图标大小 + +:::demo 通过`size`属性,设置图标大小。 + +```vue + + +``` + +::: + ### 自定义字体图标 Icon 组件默认引用 DevUI 图标库的图标,如果需要在现有 Icon 的基础上使用更多图标,可以引入第三方 iconfont 对应的字体文件和 CSS 文件,之后就可以在 Icon 组件中直接使用。 diff --git a/docs/components/table/index.md b/docs/components/table/index.md index 07cf4c4905d61fc443981556e7cda931463e3329..9492d1cf1225363aecf18b10eb025f73348ae088 100644 --- a/docs/components/table/index.md +++ b/docs/components/table/index.md @@ -114,19 +114,6 @@ } }) - - - ``` :::