Is it a good idea to mix React and Vue? [closed]

江枫思渺然 提交于 2019-12-08 04:44:27

If the main reason is "I already know Vue" then I would say no.

If they already know Vue it should be fairly easy to learn react.

I think both frameworks can work together, you can have a small feature in your React app built with Vue because even though your SPA is in React, a Vue component/app can be targeted to any html element and have that to be it's only scope.

This scenario would be a good use case for mixing both frameworks:

Lets say you already have a Vue app that calculates the best way to fill a truck with boxes of different sizes and it's sort of complex in terms of logic and UI, but really isolated from the rest of the logic in your app in that case I think embedding a Vue component/app into your React SPA would be nice because you won't have to build it again.

Example of how the scope of the Vue component is limited:

<div id="app">
  {{ message }}
</div>

var app = new Vue({
  el: '#app',
  data: {
    message: 'Hello Vue!'
  }
})

In this case you will have a Vue component that only renders hello world. https://vuejs.org/v2/guide/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!