xt-element-ui 1.1.9 → 1.1.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xt-element-ui",
3
- "version": "1.1.9",
3
+ "version": "1.1.91",
4
4
  "description": "基于 Vue2.7 + ElementUI 的组件库",
5
5
  "main": "lib/index.common.js",
6
6
  "module": "lib/index.esm.js",
@@ -6,14 +6,20 @@
6
6
  <ex-trend v-else-if="type=='trend'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-trend>
7
7
  </template>
8
8
  <script>
9
+ import ExBar from "./ExBar.vue"
10
+ import ExLine from "./ExLine.vue"
11
+ import ExPie from "./ExPie.vue"
12
+ import ExMulti from "./ExMulti.vue"
13
+ import ExTrend from "./ExTrend.vue"
14
+
9
15
  export default {
10
16
  name: "ExChart",
11
17
  components: {
12
- ExBar: () => import("./ExBar.vue"),
13
- ExLine: () => import("./ExLine.vue"),
14
- ExPie: () => import("./ExPie.vue"),
15
- ExMulti: () => import("./ExMulti.vue"),
16
- ExTrend: () => import("./ExTrend.vue")
18
+ ExBar,
19
+ ExLine,
20
+ ExPie,
21
+ ExMulti,
22
+ ExTrend
17
23
  },
18
24
  props: {
19
25
  theme: {
package/src/index.js CHANGED
@@ -96,17 +96,18 @@ const install = function (Vue, options = {}) {
96
96
  }
97
97
  }
98
98
 
99
- // 尝试获取 ElementUI(如果已安装)并注册 Ex 开头的组件
100
- let ElementUI = null
101
- try {
102
- ElementUI = require('element-ui')
103
- } catch (e) {
104
- console.warn('[XT-UI] ElementUI not found, skipping Ex- prefix registration for Element components')
105
- return
99
+ // 仅在开发环境下尝试注册 ElementUI 组件为 Ex 开头(方便文档和示例使用)
100
+ // 生产环境发布时不需要,避免不必要的依赖
101
+ if (process.env.NODE_ENV === 'development') {
102
+ try {
103
+ const ElementUI = require('element-ui')
104
+ registerElementExComponents(Vue, ElementUI)
105
+ } catch (e) {
106
+ console.warn('[XT-UI] ElementUI not found, skipping Ex- prefix registration for Element components')
107
+ }
106
108
  }
107
109
 
108
110
  // 调用统一的注册函数
109
- registerElementExComponents(Vue, ElementUI)
110
111
  }
111
112
 
112
113
  // 支持全局 script 标签引入
@@ -1 +0,0 @@
1
- .bar-box[data-v-10acd2fc]{position:relative;height:100%;width:100%}
@@ -1 +0,0 @@
1
- .line-box[data-v-386a9c5d]{position:relative;height:100%;width:100%}
@@ -1 +0,0 @@
1
- .multiline-box[data-v-18661424]{height:100%;width:100%}
@@ -1 +0,0 @@
1
- .pie-box[data-v-5100b648]{position:relative;height:100%;width:100%}
@@ -1 +0,0 @@
1
- .bar-box[data-v-36cddc14]{position:relative}