Skip to content

Instantly share code, notes, and snippets.

@y-temp4
Last active December 24, 2018 05:27
Show Gist options
  • Select an option

  • Save y-temp4/7a4148f1e2cf070add76ab0e95bde9e2 to your computer and use it in GitHub Desktop.

Select an option

Save y-temp4/7a4148f1e2cf070add76ab0e95bde9e2 to your computer and use it in GitHub Desktop.

Revisions

  1. y-temp4 revised this gist Dec 24, 2018. No changes.
  2. y-temp4 revised this gist Dec 24, 2018. No changes.
  3. y-temp4 created this gist Dec 22, 2018.
    4 changes: 4 additions & 0 deletions file1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    async getLikesCount({ commit }, { articleId }) {
    const { count: likesCount } = await this.$axios.$get(`/articles/${articleId}/likes`)
    return likesCount
    }
    24 changes: 24 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    import Vue from 'vue'
    import Vuex from 'vuex'
    import { createModule } from 'vuex-toast'
    import article from './modules/article'
    import user from './modules/user'
    import tag from './modules/tag'
    import report from './modules/report'
    import presentation from './modules/presentation'

    Vue.use(Vuex)

    export default () =>
    new Vuex.Store({
    modules: {
    article,
    user,
    tag,
    report,
    presentation,
    toast: createModule({
    dismissInterval: 2000
    })
    }
    })
    6 changes: 6 additions & 0 deletions nuxt.config.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    render: {
    - gzip: false
    + compressor: (req, res, next) => {
    + next()
    + }
    },