feat: anchor - copy link to clipboard
This commit is contained in:
@@ -2,6 +2,7 @@ import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
import alert from './modules/alert'
|
||||
import anchor from './modules/anchor'
|
||||
import adminUsersCreate from './modules/admin-users-create'
|
||||
|
||||
Vue.use(Vuex)
|
||||
@@ -20,6 +21,7 @@ export default new Vuex.Store({
|
||||
getters: {},
|
||||
modules: {
|
||||
alert,
|
||||
anchor,
|
||||
adminUsersCreate
|
||||
}
|
||||
})
|
||||
|
23
client/js/store/modules/anchor.js
Normal file
23
client/js/store/modules/anchor.js
Normal file
@@ -0,0 +1,23 @@
|
||||
'use strict'
|
||||
|
||||
export default {
|
||||
state: {
|
||||
shown: false,
|
||||
hash: ''
|
||||
},
|
||||
getters: {},
|
||||
mutations: {
|
||||
anchorChange: (state, opts) => {
|
||||
state.shown = (opts.shown === true)
|
||||
state.hash = opts.hash || ''
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
anchorOpen({ commit, dispatch }, hash) {
|
||||
commit('anchorChange', { shown: true, hash })
|
||||
},
|
||||
anchorClose({ commit, dispatch }) {
|
||||
commit('anchorChange', { shown: false })
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user