diff --git a/src/icon/README.md b/src/icon/README.md index fcf3d291c..c25a1e656 100644 --- a/src/icon/README.md +++ b/src/icon/README.md @@ -22,12 +22,34 @@ Use `name` prop to set icon name or icon URL ### Show Info +Use `dot` prop, a small red dot will be displayed in the upper right corner of the icon. + +Use `info` prop, the info will be displayed in the upper right corner of the icon. + ```html ``` +### Icon Color + +Use `color` prop to set icon color + +```html + + +``` + +### Icon Size + +Use `size` prop to set icon size + +```html + + +``` + ### Use local font file Icon uses font file in `yzcdn.cn` by default,if you want to use the local font file,please import the following css file. diff --git a/src/icon/README.zh-CN.md b/src/icon/README.zh-CN.md index 33e4e2071..168f0b41b 100644 --- a/src/icon/README.zh-CN.md +++ b/src/icon/README.zh-CN.md @@ -34,6 +34,25 @@ Vue.use(Icon); ``` + +### 图标颜色 + +`Icon`的`color`属性用来设置图标的颜色 + +```html + + +``` + +### 图标大小 + +`Icon`的`size`属性用来设置图标的尺寸大小 + +```html + + +``` + ### 使用本地字体文件 Icon 组件默认引用有赞 CDN 提供的字体文件,并通过网络下载。如果需要在项目中使用本地字体文件,请引入下面的 CSS 文件,并在项目中配置`url-loader` diff --git a/src/icon/demo/index.vue b/src/icon/demo/index.vue index 846d1d9c4..6e5086ea8 100644 --- a/src/icon/demo/index.vue +++ b/src/icon/demo/index.vue @@ -21,6 +21,49 @@ {{ icon }} + + + + + + {{ demoIcon }} + + + + {{ demoIcon }} + + + + + + {{ demoIcon }} + + + + {{ demoIcon }} + + + + + + {{ demoIcon }} + + + + {{ demoIcon }} + + + + + + {{ demoIcon }} + + + + {{ demoIcon }} + + + @@ -61,7 +104,12 @@ export default { basic: '基础图标', copied: '复制成功', outline: '线框风格', - filled: '实底风格' + filled: '实底风格', + demo: '用法示例', + dot: '图标右上角小红点', + message: '图标右上角徽标的内容', + color: '图标颜色', + size: '图标大小' }, 'en-US': { title: 'Icon List', @@ -69,7 +117,12 @@ export default { basic: 'Basic', copied: 'Copied', outline: 'Outline', - filled: 'Filled' + filled: 'Filled', + demo: 'Demo', + dot: 'Show Red Dot', + message: 'Show Info', + color: 'Icon Color', + size: 'Icon Size' } }, @@ -77,13 +130,27 @@ export default { this.BLUE = BLUE; this.icons = icons; return { - tab: 0 + tab: 0, + demoIcon: 'location-o' }; }, methods: { - copy(icon) { - const tag = ``; + copy(icon, option = {}) { + let tag = ``; copyToClipboard(tag); this.$notify({