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.
willaengine/resources/js/Global/mixins/global.js

44 lines
1.2 KiB

import { mapActions } from "vuex";
import $_can, {$_hasModule} from "@Global/policy/can";
import $_name from "@Global/utils/category-name/name";
import $_color from "@Global/utils/module-color";
const global = {
methods: {
$_getPath(subPath = "", is_complete_url = false) {
if (is_complete_url && process.env.MIX_PUSHER_APP_HAS_CDN == 'true') {
return subPath;
} else {
subPath = subPath.startsWith("/") ? subPath.substr(1) : subPath;
const path = process.env.MIX_PUSHER_APP_PUBLIC_PATH
? process.env.MIX_PUSHER_APP_PUBLIC_PATH
: "/";
return path + subPath;
}
},
//Modal
...mapActions("modal", [
"$_dialog",
"$_helper",
"__openModal",
"$_closeModal"
]),
$_openModal(name, data = {}) {
if (typeof name == 'object') {
this.__openModal(name)
} else {
this.__openModal({...data, ...{name}})
}
},
$_can,
$_hasModule,
$_name,
$_color,
}
};
export { global };