0.1.30 • Published 5 years ago
@xsyx/common-portal v0.1.30
通用 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, 默认选中项
业务模块通用要求
名称规范: m-业务名-功能名
如: m-basic-setting, m-basic-userlist
为了和 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);
},
})
}
编译选项
- 为了集成到 on portal 应用,业务模块必须以 umd 规范输出;
- 为了使用 unpkg 动态加载,业务模块必须取消代码分割,同时内联css
- 可将 Vue element 作为 externals 输出,减少业务模块打包体积
module.exports = {
filenameHashing: false,
configureWebpack: () => ({
// ...
// 取消代码分割
optimization: {
splitChunks: false
},
// 抽出公共资源减少打包体积
externals: {
vue: 'Vue',
'element-ui': 'ELEMENT',
}
// ...
}),
// 样式内联
css: {
extract: false
},
// ...
}
0.1.30
5 years ago
0.1.29
5 years ago
0.1.28
5 years ago
0.1.27
5 years ago
0.1.26
5 years ago
0.1.25
5 years ago
0.1.24
5 years ago
0.1.21
5 years ago
0.1.20
5 years ago
0.1.19
5 years ago
0.1.18
5 years ago
0.1.17
5 years ago
0.1.16
5 years ago
0.1.15
5 years ago
0.1.14
5 years ago
0.1.13
5 years ago
0.1.12
5 years ago
0.1.11
5 years ago
0.1.10
5 years ago
0.1.8
5 years ago
0.1.7
5 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago