You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
533 B

5 years ago
  1. import { make } from 'vuex-pathify'
  2. const state = {
  3. editor: '',
  4. editorKey: '',
  5. content: '',
  6. mode: 'create',
  7. activeModal: '',
  8. media: {
  9. folderTree: [],
  10. currentFolderId: 0,
  11. currentFileId: null
  12. }
  13. }
  14. export default {
  15. namespaced: true,
  16. state,
  17. mutations: {
  18. ...make.mutations(state),
  19. pushMediaFolderTree: (st, folder) => {
  20. st.media.folderTree = st.media.folderTree.concat(folder)
  21. },
  22. popMediaFolderTree: (st) => {
  23. st.media.folderTree = st.media.folderTree.slice(0, -1)
  24. }
  25. }
  26. }