🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@hbgj/common

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@hbgj/common

hbgj 公共功能

Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

公共功能汇总

npm npm npm bundle size Travis (.org)

本组件依赖 Promise

引入Promise支持推荐做法

暂时不支持个别组件按需加载,价值不大

Usage

1. `npm i @hbgj/common`
2. 引入api,你的环境需要有Promise支持
    // 你可能需@babel/polyfill 但不推荐此做法
    // import "@babel/polyfill";
    
    import Common from "@hbgj/common";
    const { Config, Util, App } = Common;
    let params = _.extend({}, {
          interType: 0,  // 0国际 1国内
          scty: "PEK",
          ecty: "SHA",
          date: "2019-12-01",
          fdate: "2019-12-11",
          cabin: "4" // // 4 经济舱,7 公务舱
        });
    // type  0 国际 1 国内
    const url = App.getTicketList(params, {type: 0 });

webpack管理项目 增加promise支持

  • 安装依赖
    npm i -S es6-promise
  • 修改webpack配置

    plugins: [
        new webpack.ProvidePlugin({
            Promise: ['es6-promise', 'Promise']
        }),
        ...
    ]

FAQs

Package last updated on 06 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts