cleaned, switched from stylus to sass

This commit is contained in:
2019-07-19 16:21:46 +02:00
parent dd40e24467
commit 01e4d99537
16 changed files with 874 additions and 161 deletions
+1 -2
View File
@@ -1,12 +1,11 @@
import Vue from 'vue'
import Vuex from 'vuex'
import posts from './modules/posts'
// https://github.com/vuejs/vuex/tree/dev/examples/shopping-cart
Vue.use(Vuex)
export default new Vuex.Store({
modules: {
posts
// search
}
})
-48
View File
@@ -1,48 +0,0 @@
import datarest from '../../api/datarest'
// initial state
const state = {
all: [],
opened: null
}
// getters
const getters = {}
// actions
const actions = {
getAllPosts ({ commit }) {
datarest.getPosts(posts => {
commit('setPosts', posts)
})
},
openPost ({ commit }, post) {
datarest.getPost(post.id, post => {
commit('setOpened', post)
})
},
closePost ({ commit }) {
commit('clearOpened')
}
}
// mutations
const mutations = {
setPosts (state, posts) {
state.all = posts
},
setOpened (state, post) {
state.opened = post
},
clearOpened (state) {
state.opened = null
}
}
export default {
namespaced: true,
state,
getters,
actions,
mutations
}
View File