Skip to content

Commit

Permalink
fix(icons-list): drop default namespace in icons list
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Feb 6, 2020
1 parent 9c548f7 commit 62d8572
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions lib/pages/icons-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
>
<div class="icon-svg">
<svg-icon
:name="sprite.name + '/' + symbol"
:title="sprite.name + '/' + symbol"
:name="symbol.path"
:title="symbol.path"
class="icon"
width="30px"
height="30px"
/>
</div>
<code class="name">
{{ symbol }}
{{ symbol.name }}
</code>
<input
class="name"
type="text"
readonly
:value="sprite.name + '/' + symbol"
:value="symbol.path"
@click="copy"
>
</div>
Expand All @@ -41,13 +41,19 @@ import sprites from '<%= options._output %>/sprites.json'
export default {
data () {
const defaultSprite = '<%= options.defaultSprite %>'
return {
sprites
}
},
head () {
return {
title: 'Icons list - nuxt-svg-sprite'
defaultSprite,
sprites: sprites.map((sprite) => {
const namespace = sprite.name !== defaultSprite ? `${sprite.name}/` : ''
return {
name: sprite.name,
symbols: sprite.symbols.map(symbol => ({
name: symbol,
path: `${namespace}${symbol}`
}))
}
})
}
},
methods: {
Expand All @@ -57,6 +63,11 @@ export default {
el.setSelectionRange(0, 99999)
document.execCommand('copy')
}
},
head () {
return {
title: 'Icons list - nuxt-svg-sprite'
}
}
}
</script>
Expand Down

0 comments on commit 62d8572

Please sign in to comment.