my-xg
v1.0.0
Published
MY前端基础框架核心组件库
Downloads
16
Readme
1 修改 my-map 配置覆盖问题
@xdh/ui/lib/map/packages/my-map/Map.js
init() { const { center, projection, zoom, minZoom, maxZoom } = this.$props const layer = createLayer(this.adapter) // 标识图层 layer.MY_LAYER = true const view = new View({ projection, center, zoom, minZoom, maxZoom, ...(this.viewOptions || {}) }) this.map = new Map({ layers: [].concat(layer), view: view, target: this.$el, // 删除默认的控件 controls: [], interactions: [ new DragPan(), new MouseWheelZoom(), new PointerInteraction({ handleEvent: this.handleEvent }) ], ...(this.mapOptions || {}) }) this.setActive(DragPan, this.dragPan) this.setActive(MouseWheelZoom, this.mouseWheelZoom) this.bindMapEvents() /** _ 地图初始化完成时触发 _ @event ready _ @param {Map} map ol/Map 实例 _ @param {VueComponent} vm Vue 实例 */ this.$emit('ready', this.map, this) addResizeListener(this.$el, this.setViewSize) this.setCanvasFilter() }
2 修改 echarts 为高版本导入方式
@xdh/ui/lib/charts/packages/my-chart/Chart.js
import echarts from 'echarts/lib/echarts' import 'echarts/lib/component/tooltip' import 'echarts/lib/component/legend' import 'echarts/lib/component/title'
改为 import echarts from 'echarts';
3 修改 echarts 默认颜色
@xdh/ui/lib/charts/utils/constant.js
export const DEFAULT_THEME = { color: ['#333333', '#1976d2', '#ffcb2f', '#6a9955', '#007acc', '#eb1c27', '#fb7293', '#0101ff', '#c57b14', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF' ] }
4 添加全局事件总线
my/ui/lib/index.js
export function appRender({ el, store, router, access }) {
return new Vue({
components: {
MyMasterApp
},
el: el,
store,
router,
access,
// 全局事件总线
beforeCreate() {
Vue.prototype.$bus = this
},
render(h) {
const props = { ...uiConfig.scale }
return h('my-master-app', { props })
}
})
}
5 关闭进度条
node_modules@xdh\my\ui\lib\enhance.js // 进度条自动每次递增 20% // progress.inc(0.2)
6 chalk 打包报错
node_modules@xdh\my\core\utils.js log(msg, type = 'primary') { const colors = { success: chalk.green, warning: chalk.bold.yellow, error: chalk.bold.red, primary: chalk.blue } console.log(colorstype) },
7(gojs 打包问题)
node_modules@xdh\my\ui\lib\gojs\utils\lib.js
const go = process.env.NODE_ENV === 'production' ? require('gojs/release/go') : require('gojs/release/go-debug') 改成 const go = require('gojs/release/go-debug')