isv-robot 2 年之前
父节点
当前提交
6b4ff5f772
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      src/utils/globalFunction.js

+ 10 - 0
src/utils/globalFunction.js

@@ -0,0 +1,10 @@
+export default {
+  install(Vue) {
+    Vue.prototype.EchartfontSize = (res) => {
+      const clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
+      if (!clientWidth) return
+      const fontSize = (clientWidth / 1920)
+      return res * fontSize
+    }
+  }
+}