This commit is contained in:
Cole Bemis 2017-01-28 22:01:18 -08:00
parent 29abfc96cf
commit 4c6b7ad3b8
3 changed files with 30 additions and 15 deletions

View File

@ -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"
}

View File

@ -3,7 +3,11 @@
</template>
<script>
import {mapState} from 'vuex';
export default {
name: 'App'
name: 'App',
components: {Icon},
computed: mapState(['icons'])
}
</script>

View File

@ -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/>'
});