diff options
author | Phil Hughes <me@iamphill.com> | 2017-11-30 09:52:58 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-11-30 09:52:58 +0000 |
commit | 386cbf22ee8fc1d206e76f0f34568379ae726e02 (patch) | |
tree | 4976d52023637beaa5046035b64554dd451f0d27 /app/assets/javascripts/vue_shared/components/icon.vue | |
parent | 1880809d8ef9b650d1af615ebbaa590626ccf17f (diff) | |
parent | 73e48b745c34c048c56abf28e6c278707d9bd2f3 (diff) | |
download | gitlab-ce-386cbf22ee8fc1d206e76f0f34568379ae726e02.tar.gz |
Merge branch 'master' into multi-file-editor-dirty-diff-indicator
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/icon.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/icon.vue | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/assets/javascripts/vue_shared/components/icon.vue b/app/assets/javascripts/vue_shared/components/icon.vue index 8f116233e72..4216660da8c 100644 --- a/app/assets/javascripts/vue_shared/components/icon.vue +++ b/app/assets/javascripts/vue_shared/components/icon.vue @@ -12,6 +12,9 @@ /> */ + // only allow classes in images.scss e.g. s12 + const validSizes = [8, 12, 16, 18, 24, 32, 48, 72]; + export default { props: { name: { @@ -22,7 +25,10 @@ size: { type: Number, required: false, - default: 0, + default: 16, + validator(value) { + return validSizes.includes(value); + }, }, cssClasses: { @@ -42,10 +48,11 @@ }, }; </script> + <template> <svg :class="[iconSizeClass, cssClasses]"> - <use + <use v-bind="{'xlink:href':spriteHref}"/> </svg> </template> |