Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xsyx/common-portal

Package Overview
Dependencies
Maintainers
8
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xsyx/common-portal

```javascript import commonPortal from '@xsyx/common-portal'

  • 0.1.30
  • latest
  • npm
  • Socket score

Version published
Maintainers
8
Created
Source

通用 PORTAL 平台原型

import commonPortal from '@xsyx/common-portal'


// use

<common-portal injections brand system-name nav-src default-open default-active/>

  • injections: 可选,注入配置,调试时期用于模拟数据
  • brand: string, 平台左上角logo
  • system-name: string, 平台名称
  • nav-src: function, 返回一个获取导航配置的 Promise
  • default-open: array, 当前展开的导航项
  • default-active: string, 默认选中项

业务模块通用要求

  1. 名称规范: m-业务名-功能名

如: m-basic-setting, m-basic-userlist

  1. 为了和 one portal 对接, 入口要求以function 包裹,从而接入 portal 应用的上下文,如下

vue 默认

new Vue({
    el: selector,
    render(h){
        return h(App);
    },
})

注入 portal 上下文

export default function(selector, context){
    return new Vue({
        el: selector,
        render(h){
            return h(App);
        },
    })
}

编译选项

  1. 为了集成到 on portal 应用,业务模块必须以 umd 规范输出;
  2. 为了使用 unpkg 动态加载,业务模块必须取消代码分割,同时内联css
  3. 可将 Vue element 作为 externals 输出,减少业务模块打包体积
module.exports = {
    filenameHashing: false,
    configureWebpack: () => ({
        // ...
        // 取消代码分割
        optimization: {
            splitChunks: false
        },
        // 抽出公共资源减少打包体积
        externals: {
            vue: 'Vue',
            'element-ui': 'ELEMENT',
        }
        // ...
    }),
    // 样式内联
    css: {
        extract: false
    },
    // ...
}

FAQs

Package last updated on 23 Oct 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc