Put some getters function in their scope
Former-commit-id: c8e24ec73146144c4d3405f794b012b492a3aa9d [formerly a505f8f7a4ea151ccc0c116fa6df9719528905d1] [formerly f9cff4e146404428d4b811f66634ce1181b89831 [formerly f0e9b2a6339a56196cf0a9b4abd2e7f20def2ae0]] Former-commit-id: e8c459cd608a54e2ce355d173a6639d28a4c097e [formerly b0a78e53c5ac56cd30a90c55f09aa45034e6b808] Former-commit-id: 1e3f803e9bdc5df044a2a8cf9b97dc25235b20bc
This commit is contained in:
parent
7bf46bfd32
commit
10c336f6d6
|
@ -22,7 +22,7 @@ import Download from './Download'
|
||||||
import Move from './Move'
|
import Move from './Move'
|
||||||
import NewFile from './NewFile'
|
import NewFile from './NewFile'
|
||||||
import NewDir from './NewDir'
|
import NewDir from './NewDir'
|
||||||
import {mapGetters, mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'prompts',
|
name: 'prompts',
|
||||||
|
@ -38,17 +38,15 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['prompt']),
|
...mapState(['prompt']),
|
||||||
...mapGetters([
|
showInfo: function () { return this.prompt === 'info' },
|
||||||
'showOverlay',
|
showHelp: function () { return this.prompt === 'help' },
|
||||||
'showInfo',
|
showDelete: function () { return this.prompt === 'delete' },
|
||||||
'showHelp',
|
showRename: function () { return this.prompt === 'rename' },
|
||||||
'showDelete',
|
showMove: function () { return this.prompt === 'move' },
|
||||||
'showRename',
|
showNewFile: function () { return this.prompt === 'newFile' },
|
||||||
'showMove',
|
showNewDir: function () { return this.prompt === 'newDir' },
|
||||||
'showNewFile',
|
showDownload: function () { return this.prompt === 'download' },
|
||||||
'showNewDir',
|
showOverlay: function () { return this.prompt !== null }
|
||||||
'showDownload'
|
|
||||||
])
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
resetPrompts () {
|
resetPrompts () {
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
const getters = {
|
const getters = {
|
||||||
showInfo: state => (state.prompt === 'info'),
|
|
||||||
showHelp: state => (state.prompt === 'help'),
|
|
||||||
showDelete: state => (state.prompt === 'delete'),
|
|
||||||
showRename: state => (state.prompt === 'rename'),
|
|
||||||
showMove: state => (state.prompt === 'move'),
|
|
||||||
showNewFile: state => (state.prompt === 'newFile'),
|
|
||||||
showNewDir: state => (state.prompt === 'newDir'),
|
|
||||||
showDownload: state => (state.prompt === 'download'),
|
|
||||||
showOverlay: state => (state.prompt !== null),
|
|
||||||
selectedCount: state => state.selected.length
|
selectedCount: state => state.selected.length
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue