Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
Added icon component
Browse files Browse the repository at this point in the history
  • Loading branch information
romanslonov committed Apr 24, 2019
1 parent 29c3546 commit 5bcf661
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/Icon/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Icon from './main.vue';

// eslint-disable-next-line func-names
Icon.install = function (Vue) {
Vue.component('VIcon', Icon);
};

export default Icon;
25 changes: 25 additions & 0 deletions src/components/Icon/main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<template>
<svg :width="width" :height="height">
<use :xlink:href="`#${name}`"></use>
</svg>
</template>

<script>
export default {
name: 'VIcon',
props: {
name: {
type: String,
required: true,
},
width: {
type: String,
default: '20',
},
height: {
type: String,
default: '20',
},
},
};
</script>
1 change: 1 addition & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export { default as VCheckbox } from './Checkbox';
export { default as VCheckboxGroup } from './CheckboxGroup';
export { default as VChip } from './Chip';
export { default as VDropdown } from './Dropdown';
export { default as VIcon } from './Icon';
export { default as VMenu } from './Menu';
export { default as VMenuOption } from './MenuOption';
export { default as VModal } from './Modal';
Expand Down

0 comments on commit 5bcf661

Please sign in to comment.