@es-plus/vue2 1.0.1 → 1.0.2

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.
@@ -1,18 +1,16 @@
1
1
  /**
2
- * Vue 2 兼容层 —— 单点 re-export
2
+ * Vue 2 兼容层 —— 通过 vue-demi 自动适配
3
3
  *
4
- * 设计目标:
5
- * - 源码统一 `import { ref } from './vue-compat'`,不直接从 'vue' 导入
6
- * - 这样 Vue 2.6 / Vue 2.7 / 未来切换 vue-demi 都只改这一个文件
4
+ * vue-demi 在运行时自动判断环境:
5
+ * - Vue 2.7+:从 vue 导出 Composition API(原生支持)
6
+ * - Vue 2.6 + @vue/composition-api:从 @vue/composition-api 导出
7
+ * - Vue 3:从 vue 导出
7
8
  *
8
- * 当前实现:从 'vue' 直接 re-export
9
- * - Vue 2.7+:原生支持 Composition API,开箱即用
10
- * - Vue 2.6:用户需在 main.js 调用 Vue.use(VueCompositionAPI),
11
- * 并配置 bundler resolve.alias('vue', '@vue/composition-api')
12
- * (或直接升级到 2.7+,更省事)
13
- *
14
- * Vue 实例本身(Vue.extend / Vue.component)也由本文件暴露,供 useDialog 编程式弹窗使用。
9
+ * 用户无需配置 webpack resolve.alias,开箱即用。
10
+ * Vue 2.6 用户只需:
11
+ * 1. npm install @vue/composition-api
12
+ * 2. main.js 中 Vue.use(VueCompositionAPI)
15
13
  */
16
- export { default as Vue, ref, reactive, computed, watch, watchEffect, onMounted, onUnmounted, onBeforeUnmount, onBeforeMount, onUpdated, onActivated, onDeactivated, defineComponent, inject, provide, nextTick, getCurrentInstance, toRefs, toRef, unref, isRef, h, } from 'vue';
17
- export type { PropType, Ref, ComputedRef, WatchSource } from 'vue';
14
+ export { Vue2 as Vue, ref, reactive, computed, watch, watchEffect, onMounted, onUnmounted, onBeforeUnmount, onBeforeMount, onUpdated, onActivated, onDeactivated, defineComponent, inject, provide, nextTick, getCurrentInstance, toRefs, toRef, unref, isRef, h, } from 'vue-demi';
15
+ export type { PropType, Ref, ComputedRef, WatchSource } from 'vue-demi';
18
16
  //# sourceMappingURL=vue-compat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vue-compat.d.ts","sourceRoot":"","sources":["../src/vue-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,OAAO,IAAI,GAAG,EACd,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EACb,eAAe,EACf,MAAM,EACN,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAK,EACL,CAAC,GACF,MAAM,KAAK,CAAA;AAEZ,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA"}
1
+ {"version":3,"file":"vue-compat.d.ts","sourceRoot":"","sources":["../src/vue-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,IAAI,IAAI,GAAG,EACX,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EACb,eAAe,EACf,MAAM,EACN,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAK,EACL,CAAC,GACF,MAAM,UAAU,CAAA;AAEjB,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@es-plus/vue2",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "es-plus for Vue 2 + Element UI: configuration-driven enterprise components, sharing the same JSON config schema as @es-plus/vue3 (Vue 3 + Element Plus)",
5
5
  "main": "./dist/es-plus-vue2.umd.cjs",
6
6
  "module": "./dist/es-plus-vue2.js",
@@ -69,7 +69,8 @@
69
69
  }
70
70
  },
71
71
  "dependencies": {
72
- "@es-plus/core": "^1.0.0"
72
+ "@es-plus/core": "^1.0.0",
73
+ "vue-demi": "^0.14.10"
73
74
  },
74
75
  "devDependencies": {
75
76
  "@types/node": "^20.0.0",