Skip to content

Commit

Permalink
release: v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Maorey committed Dec 24, 2019
1 parent a9dbe92 commit 4f6e1ec
Show file tree
Hide file tree
Showing 9 changed files with 684 additions and 292 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ http {
- [#714](https://github.com/webpack-contrib/sass-loader/issues/714): 【不再考虑支持】可追踪引用, 使在 js 中引用 scss 时可正确<a href="#全局scss">注入 scss 变量</a>
- scss 模块化: 已出 beta 但生态不完善, [草案](https://github.com/sass/sass/blob/master/accepted/module-system.md)
- [微前端化](https://github.com/phodal/microfrontends#复合型): 应考虑基于 [Web Components](https://developer.mozilla.org/zh-CN/docs/Web/Web_Components) ([vue 友好](https://cli.vuejs.org/zh/guide/build-targets.html#web-components-组件), 可以兼容其他) 的集成和通信.
- `tsx` 类型支持(去掉`as any`, 利于重构)
### 其他
Expand Down
2 changes: 1 addition & 1 deletion build/shortString.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
// return key !== 0 ? str : shortStr(DIC, ++count)
// }

const CHAR = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_'
const CHAR = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
const RADIX = CHAR.length
/** 数字转RADIX进制字符串
* @param {Number} number 10进制数字
Expand Down
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-tpl",
"author": "毛瑞 <[email protected]>",
"version": "1.0.0",
"version": "1.0.1",
"private": false,
"license": "MIT",
"keywords": [
Expand All @@ -28,7 +28,7 @@
},
"dependencies": {
"axios": "^0.19.0",
"core-js": "^3.5.0",
"core-js": "^3.6.0",
"crypto-js": "^3.1.9-1",
"d3": "^5.14.2",
"echarts": "^4.5.0",
Expand All @@ -43,7 +43,7 @@
"three": "^0.111.0",
"vue": "^2.6.11",
"vue-class-component": "^7.1.0",
"vue-i18n": "^8.15.1",
"vue-i18n": "^8.15.3",
"vue-property-decorator": "^8.3.0",
"vue-router": "^3.1.3",
"vuex": "^3.1.2",
Expand All @@ -56,9 +56,9 @@
"@types/crypto-js": "^3.1.43",
"@types/d3": "^5.7.2",
"@types/echarts": "^4.4.2",
"@types/jest": "^24.0.23",
"@typescript-eslint/eslint-plugin": "^2.12.0",
"@typescript-eslint/parser": "^2.12.0",
"@types/jest": "^24.0.24",
"@typescript-eslint/eslint-plugin": "^2.13.0",
"@typescript-eslint/parser": "^2.13.0",
"@vue/cli-plugin-babel": "^4.1.1",
"@vue/cli-plugin-e2e-cypress": "^4.1.1",
"@vue/cli-plugin-eslint": "^4.1.1",
Expand All @@ -72,7 +72,7 @@
"@vue/eslint-config-typescript": "^5.0.1",
"@vue/test-utils": "^1.0.0-beta.30",
"compression-webpack-plugin": "^3.0.1",
"eslint": "^6.7.2",
"eslint": "^6.8.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
Expand All @@ -81,16 +81,17 @@
"fibers": "^4.0.2",
"hard-source-webpack-plugin": "^0.13.1",
"lint-staged": "^9.5.0",
"mini-css-extract-plugin": "Maorey/alternate-css-extract-plugin#6f33336a0fe8ce92caff63eb307775f3e63d9a5b",
"mini-css-extract-plugin": "Maorey/alternate-css-extract-plugin#705c51ae4060bcb8f1a7686976b75f4ef9103f2b",
"postcss-preset-env": "^6.7.0",
"regenerate": "^1.4.0",
"regjsgen": "^0.5.1",
"regjsparser": "^0.6.1",
"sass": "^1.23.7",
"regjsparser": "^0.6.2",
"sass": "^1.24.0",
"sass-loader": "^8.0.0",
"stylelint": "^12.0.0",
"stylelint-config-scss-maorey": "^1.1.1",
"stylelint-webpack-plugin": "^1.1.2",
"typescript": "^3.7.3",
"typescript": "^3.7.4",
"unicode-match-property-ecmascript": "^1.0.4",
"unicode-match-property-value-ecmascript": "^1.1.0",
"vue-template-compiler": "^2.6.11",
Expand Down
2 changes: 2 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ module.exports = {
autoprefixer: {
grid: 'autoplace',
},
// https://github.com/csstools/postcss-preset-env
'postcss-preset-env': {},
},
}
18 changes: 7 additions & 11 deletions src/pages/index/libs/echarts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,9 @@ let idMap: IObject<IArguments> = {}
/// hack 方法 ///
let orginSetOption: Function
const orginInit = echarts.init
echarts.init = function(
dom: HTMLDivElement,
theme?: string | IObject,
opts?: IObject
) {
echarts.init = function(dom: any, theme?: string | IObject, opts?: IObject) {
const instance = orginInit.call(this, dom, theme || get(), opts)
instance.$ = opts
;(instance as any).$ = opts

if (!orginSetOption) {
try {
Expand All @@ -60,7 +56,7 @@ echarts.init = function(
// 定时清理
// setInterval(() => {
// for (const id of idSet) {
// instanceSet.has(echarts.getInstanceById(id)) || idSet.delete(id)
// instanceSet.has((echarts as any).getInstanceById(id)) || idSet.delete(id)
// }
// }, CONFIG.apiCacheAlive << 3)

Expand All @@ -73,16 +69,16 @@ on(process.env.SKIN_FIELD, skin => {
let opts
let id
for (id in idMap) {
if ((instance = echarts.getInstanceById(id))) {
if ((instance = (echarts as any).getInstanceById(id))) {
args = idMap[id]
opts = instance.$
opts = (instance as any).$
id = instance.getDom()
instance.dispose()

instance = echarts.init(id, skin, opts)
orginSetOption.apply(instance, args)

newIdMap[instance.id] = args
newIdMap[(instance as any).id] = args
}
}

Expand All @@ -94,7 +90,7 @@ window.addEventListener('resize', () => {
let id
let instance
for (id in idMap) {
;(instance = echarts.getInstanceById(id)) && instance.resize()
;(instance = (echarts as any).getInstanceById(id)) && instance.resize()
}
})

Expand Down
5 changes: 1 addition & 4 deletions src/shims-modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ declare module '*.css' {
const content: object
export default content
}

declare module '*.png' {
/** 图片路径或base64字符串
*/
Expand Down Expand Up @@ -57,13 +56,13 @@ declare module '*.svg' {
const content: string
export = content
}

declare module '*.json' {
/** 得到json表达的对象/数组【混入到代码中】
*/
const content: object | any[]
export default content
}

// 需要配置loader,否则会当成js eval(内容)
// declare module '*.text' {
// /** 文件内容
Expand All @@ -85,8 +84,6 @@ declare module '*.json' {
// export default plugin
// }

declare module 'jsencrypt'

/// hack 放最后 ///
// declare module 'zrender/lib/*'
// declare module 'zdog/js/*'
Expand Down
Loading

0 comments on commit 4f6e1ec

Please sign in to comment.