mirror of
https://github.com/feathericons/feather.git
synced 2023-08-10 21:13:24 +03:00
Clear gh-pages branch
This commit is contained in:
21
src/App.vue
21
src/App.vue
@ -1,21 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<icon-grid :icons="icons"></icon-grid>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex';
|
||||
import IconGrid from './IconGrid';
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {IconGrid},
|
||||
computed: mapState(['icons'])
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
body
|
||||
margin 0
|
||||
</style>
|
49
src/Icon.vue
49
src/Icon.vue
@ -1,49 +0,0 @@
|
||||
<template>
|
||||
<div class="icon"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Icon',
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: '24'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
fetch(`./icons/${this.name}.svg`)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.text();
|
||||
}
|
||||
throw new Error(`Cannot find ${this.name}.svg`);
|
||||
})
|
||||
.then(svgText => {
|
||||
const svgDocument = new DOMParser().parseFromString(svgText, 'image/svg+xml');
|
||||
const svgIcon = svgDocument.querySelector('svg').cloneNode(true);
|
||||
|
||||
svgIcon.setAttribute('width', this.size);
|
||||
svgIcon.setAttribute('height', this.size);
|
||||
|
||||
this.$el.appendChild(svgIcon);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
.icon
|
||||
display inline-block
|
||||
line-height 0
|
||||
|
||||
.icon > svg
|
||||
stroke currentColor
|
||||
</style>
|
@ -1,22 +0,0 @@
|
||||
<template>
|
||||
<div class="icon-container">
|
||||
<a :href="`icons/${name}.svg`" download>
|
||||
<icon :name="name" size="48"></icon>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Icon from './Icon';
|
||||
|
||||
export default {
|
||||
name: 'IconContainer',
|
||||
components: {Icon},
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,20 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<icon-container v-for="icon in icons" :name="icon"></icon-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IconContainer from './IconContainer';
|
||||
|
||||
export default {
|
||||
name: 'IconGrid',
|
||||
components: {IconContainer},
|
||||
props: {
|
||||
icons: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
25
src/main.js
25
src/main.js
@ -1,25 +0,0 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import App from './App';
|
||||
|
||||
const icons = [
|
||||
'square',
|
||||
'circle',
|
||||
'rectangle-vertical',
|
||||
'rectangle-horizontal'
|
||||
];
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
icons
|
||||
}
|
||||
});
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
components: {App},
|
||||
template: '<app/>'
|
||||
});
|
Reference in New Issue
Block a user