@mudas/env
v0.0.5
Published
A plugin for environment
Downloads
2
Readme
env
A plugin that supports Vue to dispatch global events.
Setup
install:
npm i @mudas/env -S
You need to add configuration for vue-cli to correctly translate the es module in node_modules:
// vue.config.js:
module.exports = {
transpileDependencies: [
'@mudas/*' // all of node_module for '@mudas'
]
}
Usage
import { parsingUserAgentEnv, parsingAppletEnv, parsingURLParams } from '@mudas/env';
// Applet ENV
parsingApplet({ ...parsingUserAgent(), ...parsingURLParams() }).then((data) => {
// ... return types/EnvHolderType & { wechatApplet:boolean, alipayApplet:boolean }
});