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": "^2.1.10",
"vue-loader": "^10.1.2", "vue-loader": "^10.1.2",
"vue-template-compiler": "^2.1.10", "vue-template-compiler": "^2.1.10",
"vuex": "^2.1.1",
"webpack": "^2.2.0", "webpack": "^2.2.0",
"webpack-dev-server": "^1.16.2" "webpack-dev-server": "^1.16.2"
} }

View File

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

View File

@ -1,14 +1,28 @@
import Vue from 'vue'; import Vue from 'vue';
import Vuex from 'vuex';
import App from './App'; import App from './App';
const data = { const icons = [
icons: [ 'square',
'square', 'circle',
'circle', 'rectangle-vertical',
'rectangle-vertical', 'rectangle-horizontal'
'rectangle-horizontal' ];
]
}; Vue.use(Vuex);
const store = new Vuex.Store({
state: {
icons
}
});
new Vue({
el: '#app',
store,
components: {App},
template: '<app/>'
});
// Vue.component('icon', { // Vue.component('icon', {
// props: { // props: {
@ -55,9 +69,5 @@ const data = {
// template: '#icon-container-template' // template: '#icon-container-template'
// }) // })
new Vue({
el: '#app',
data: data,
components: {App},
template: '<app/>'
});