remesh-js / remesh

A CQRS-based DDD framework for large and complex TypeScript/JavaScript applications
https://remesh-js.github.io/remesh/dist/index.html
MIT License
653 stars 40 forks source link

remesh如何在vue2.6中使用 #72

Closed FEYeh closed 1 year ago

FEYeh commented 1 year ago

请教下,因为老项目升级成本太高,想试试看在vue 2.6下使用remesh,是否可以有demo可以提供呢

hourong88 commented 1 year ago

您好!您的邮件已收到!我查阅后,尽快回复您!

github-actions[bot] commented 1 year ago

Thank feedback. We will check it later:-)

Lucifier129 commented 1 year ago

原则上,remesh 只支持 vue 3.x 版本。

但据说 vue 2.x 也增加了很多 vue 3.x 相关的特性,因此也不排除 remesh 可以运行在 vue 2.x 的可能性。

从源码层面,remesh 依赖 vue 以下特性:

import { InjectionKey, Plugin, inject, Ref, ref, onMounted, onBeforeUnmount } from 'vue'

可以在 vue 2.x 里试试。

FEYeh commented 1 year ago

image image 试了下,在remesh-vue中的app.provide是undefined的,这块用法不对吗 因为vue2.7也没有createApp 只能Vue.use(RemeshVue(remeshStore))

如果说直接用provide而不用app.provide,那只能在setup中使用,也没法被绑到app上 这块能给的demo吗,Thanks♪(・ω・)ノ

Lucifier129 commented 1 year ago

看起来 remesh-vue 无法运行在 vue 2.x 中,考虑官方表示 vue 2.x 将在今年年底 EOLremesh-vue 还是专注于支持 vue 3.x 版本。

对于 vue 2.x 版本,可以参考 remesh-vue 的源码,在你们的项目中编写相关的适配模块,理论上应该可行。