cj-toolkit-x2
v0.0.2
Published
a general javascript toolkit!
Downloads
5
Readme
1.使用方式 在项目中创建一个js
import {appStore, installer} from "an-easy-toolkit/dist";
import {CacheManager} from "an-easy-toolkit/dist/typings";
import messages,{MessagesUtils} from "@/utils/messages";
// 安装一个消息插件
appStore.install("messages", messages);
import {AppConfig, AppStore} from "an-easy-toolkit/dist/manager"; // 引入插件
installer((config:AppConfig,app:AppStore)=>{
console.log();
})
let cacheManager:CacheManager = appStore.getPlugin("cacheManager") as CacheManager;
export function getCacheManager():CacheManager{
if(!cacheManager){
cacheManager = appStore.getPlugin("cacheManager") as CacheManager;
}
return cacheManager
}
export function getMessagesUtils():MessagesUtils{
return messages
}