mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-27 18:40:39 +00:00
vue frontend update
This commit is contained in:
Vendored
+14
-1
@@ -1,5 +1,5 @@
|
||||
import store from './store/index'
|
||||
import {debounce} from "lodash";
|
||||
import {debounce, includes} from "lodash";
|
||||
import {events} from './bus'
|
||||
import axios from 'axios'
|
||||
|
||||
@@ -221,6 +221,19 @@ const Helpers = {
|
||||
return store.getters.currentFolder && store.getters.currentFolder.location === 'base' ? true : false
|
||||
}
|
||||
|
||||
Vue.prototype.$checkPermission = function(type) {
|
||||
|
||||
let currentPermission = store.getters.permission
|
||||
|
||||
// Check if type is object
|
||||
if (typeof type === 'Object' || type instanceof Object) {
|
||||
return includes(type, currentPermission)
|
||||
|
||||
} else {
|
||||
return currentPermission === type
|
||||
}
|
||||
}
|
||||
|
||||
Vue.prototype.$isMobile = function() {
|
||||
const toMatch = [
|
||||
/Android/i,
|
||||
|
||||
Reference in New Issue
Block a user