mirror of
https://github.com/feathericons/feather.git
synced 2023-08-10 21:13:24 +03:00
Add vuex
This commit is contained in:
parent
29abfc96cf
commit
4c6b7ad3b8
@ -12,6 +12,7 @@
|
||||
"vue": "^2.1.10",
|
||||
"vue-loader": "^10.1.2",
|
||||
"vue-template-compiler": "^2.1.10",
|
||||
"vuex": "^2.1.1",
|
||||
"webpack": "^2.2.0",
|
||||
"webpack-dev-server": "^1.16.2"
|
||||
}
|
||||
|
@ -3,7 +3,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'App'
|
||||
name: 'App',
|
||||
components: {Icon},
|
||||
computed: mapState(['icons'])
|
||||
}
|
||||
</script>
|
38
src/main.js
38
src/main.js
@ -1,14 +1,28 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import App from './App';
|
||||
|
||||
const data = {
|
||||
icons: [
|
||||
'square',
|
||||
'circle',
|
||||
'rectangle-vertical',
|
||||
'rectangle-horizontal'
|
||||
]
|
||||
};
|
||||
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/>'
|
||||
});
|
||||
|
||||
// Vue.component('icon', {
|
||||
// props: {
|
||||
@ -55,9 +69,5 @@ const data = {
|
||||
// template: '#icon-container-template'
|
||||
// })
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: data,
|
||||
components: {App},
|
||||
template: '<app/>'
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user