Comments (3)
将组件注册到全局,就可以实现 JS / TS 组件互相调用;
数据传输的话也是可以的:
- 方式一:主项目中注册一个全局事件总线,在 JS 项目和 TS 项目里使用
this.bus.$emit
和this.bus.$on
通信; - 方式二:使用 vuex;
但是这种场景下是不是没必要拆分成独立的两个子项目呢
from preload-routes.
将组件注册到全局,就可以实现 JS / TS 组件互相调用;
数据传输的话也是可以的:
- 方式一:主项目中注册一个全局事件总线,在 JS 项目和 TS 项目里使用
this.bus.$emit
和this.bus.$on
通信;- 方式二:使用 vuex;
但是这种场景下是不是没必要拆分成独立的两个子项目呢
我们项目要求子项目可以独立运行,但是又可以实现这种相互交互的操作
from preload-routes.
@HaoDaYiGuoFan
将组件注册到全局,就可以实现 JS / TS 组件互相调用;
数据传输的话也是可以的:
- 方式一:主项目中注册一个全局事件总线,在 JS 项目和 TS 项目里使用
this.bus.$emit
和this.bus.$on
通信;- 方式二:使用 vuex;
但是这种场景下是不是没必要拆分成独立的两个子项目呢
我们项目要求子项目可以独立运行,但是又可以实现这种相互交互的操作
可以通过类似sso的方式,毕竟以后多个项目可能存在多个技术栈,多个子项目通信最好通过windows或者注册一个全局事件总线,参考:https://github.com/hubvue/Micro-FE
from preload-routes.
Related Issues (11)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from preload-routes.