<div align=center>
<img src="https://raw.githubusercontent.com/devilwjp/VueReact/master/vuereact-combined.png"/>
</div>
<h1 align=center>Veaury</h1>
<h2 align=center>Use React in Vue3 and Vue3 in React, And as perfect as possible!</h2>
<p align="center">
<a href="https://coveralls.io/github/devilwjp/veaury?branch=master"><img src="https://coveralls.io/repos/github/devilwjp/veaury/badge.svg?branch=master" alt="Coverage Status"></a>
<a href="https://www.npmjs.com/package/veaury"><img src="https://img.shields.io/npm/v/veaury" alt="Version"></a>
<a href="https://npmcharts.com/compare/veaury?minimal=true"><img src="https://img.shields.io/npm/dm/veaury" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/veaury"><img src="https://img.shields.io/bundlephobia/minzip/veaury" alt="Size"></a>
</p>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [What is Veaury?](#what-is-veaury)
- [The greatest feature](#the-greatest-feature)
- [Legacy](#legacy)
- [Latest documentation](#latest-documentation)
- [Use cases](#use-cases)
- [Installation](#installation)
- [Do you want to preconfigure your project in advance?](#do-you-want-to-preconfigure-your-project-in-advance)
- [Webpack](#webpack)
- [Vite](#vite)
- [Usage](#usage)
- [Vue in React - Basic usage](#vue-in-react---basic-usage)
- [React in Vue - Basic usage](#react-in-vue---basic-usage)
- [Vue in React - Usage of events](#vue-in-react---usage-of-events)
- [React in Vue - Usage of events](#react-in-vue---usage-of-events)
- [Vue in React - Usage of slots](#vue-in-react---usage-of-slots)
- [React in Vue - Usage of render props and React node](#react-in-vue---usage-of-render-props-and-react-node)
- [Context](#context)
- [Vue in React - Usage of Provider / useContext](#vue-in-react---usage-of-provider--usecontext)
- [React in Vue - Usage of Provide / Inject](#react-in-vue---usage-of-provide--inject)
- [Usage of VueContainer in React Component](#usage-of-vuecontainer-in-react-component)
- [Usage of getVNode](#usage-of-getvnode)
- [Usage of getReactNode](#usage-of-getreactnode)
- [Usage of RenderReactNode](#usage-of-renderreactnode)
- [Vue in React, Usage of v-model / v-models](#vue-in-react-usage-of-v-model--v-models)
- [Option useInjectPropsFromWrapper](#option-useinjectpropsfromwrapper)
- [Usage of injecting React hooks in Vue component](#usage-of-injecting-react-hooks-in-vue-component)
- [Usage of injecting Vue hooks in React component](#usage-of-injecting-vue-hooks-in-react-component)
- [Crossing provider](#crossing-provider)
- [Usage of createCrossingProviderForVueInReact](#usage-of-createcrossingproviderforvueinreact)
- [Usage of createCrossingProviderForReactInVue](#usage-of-createcrossingproviderforreactinvue)
- [ReactMissVue](#reactmissvue)
- [Usage of createReactMissVue](#usage-of-createreactmissvue)
- [Usage of lazyReactInVue](#usage-of-lazyreactinvue)
- [Usage of lazyVueInReact](#usage-of-lazyvueinreact)
- [Usage of getting ref](#usage-of-getting-ref)
- [Typescript JSX types conflict caused by Vue and React at the same time.](#typescript-jsx-types-conflict-caused-by-vue-and-react-at-the-same-time)
- [Development Setup](#development-setup)
- [Project Structure](#project-structure)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## What is Veaury?
Veaury (pronounced /ËvjuËri/, inspired by 'beauty') is a tool library.
It is built on the Vue and React framework. It's use cases include using both Vue and React in one app, migrating from React to Vue or from Vue to React, and using third-party Vue and React Components, such as `antd`, `element-ui`, `vuetify`.
## The greatest feature
- ð Support Vue3
- ð Support Context - Share the context of all vue and react components.
- ð Support for using hooks across frameworks - You can use React's hooks in a Vue component, or you can use Vue's 'setup' function in a React component and use Vue's hooks in this function.
- ðª Pure mode - The children of the converted component no longer have an extra element container. [>>learn more about how the pure mode works](https://github.com/devilwjp/veaury/blob/master/pure_mode.md)
## Legacy
The perfect [tool library](https://github.com/devilwjp/vuereact-combined) which can use React in Vue2 and Vue2 in React.
## Latest documentation
View the latest [documentation](https://github.com/devilwjp/veaury#readme)
[ä¸æææ¡£](https://github.com/devilwjp/veaury/blob/master/README_zhcn.md)
## Use cases
- ð¨âð©âð§ Using both Vue and React in one app
- ð Migrating from React to Vue or from Vue to React
- ð² Using third-party Vue and React Components, such as `antd`, `element-ui`, `vuetify`
## Installation
```sh
# Install with yarn:
$ yarn add veaury
# or with npm:
$ npm i veaury -S
```
## Do you want to preconfigure your project in advance?
In theory, you don't need to do additional configuration in a React project to support Vue, nor do you need to do additional configuration in a Vue project to support React.
If the React or Vue component you want to convert comes from a npm package, or has already been built (Not a direct vue file and does not contain jsx), you can use `applyPureReactInVue` or `applyVueInReact` directly.
If you need to develop both Vue and React in a project, instead of just using an existing npm component (There are both .vue files and react jsx files in a project source code), then you should do some configuration.
### Webpack
[How to configure React in the Vue project from '@vue/cli' ](https://github.com/devilwjp/veaury/tree/master/dev-project-vue3)
[How to configure Vue in the React project from 'create-react-app' ](https://github.com/devilwjp/veaury/tree/master/dev-project-react)
### Vite
If it is a project built by `vite`, the relevant configuration is as follows.
First install `@vitejs/plugin-react`, `@vitejs/plugin-vue` and `@vitejs/plugin-vue-jsx`.
+ The main project is Vue:
```js
import { defineConfig } from 'vite'
// >= veaury@2.1.1
import veauryVitePlugins from 'veaury/vite/index.js'
export default defineConfig({
plugins: [
// Turn off vue and vuejsx plugins
// vue(),
// vueJsx(),
// When the type of veauryVitePlugins is set to vue,
// only jsx in files in the directory named 'react_app' will be parsed with react jsx,
// and jsx in other files will be parsed with vue jsx
veauryVitePlugins({
type: 'vue',
// Configuration of @vitejs/plugin-vue
// vueOptions: {...},
// Configuration of @vitejs/plugin-react
// reactOptions: {...},
// Configuration of @vitejs/plugin-vue-jsx
// vueJsxOptions: {...}
})
]
})
```
+ The main project is React:
```js
import { defineConfig } from 'vite'
// >= veaury@2.1.1
import veauryVitePlugins from 'veaury/vite/index.js'
export default defineConfig({
plugins: [
// Turn off react plugin
// react(),
// When the type of veauryVitePlugins is set to react,
// only jsx in .vue file will be parsed with vue jsx,
// jsx in other files will be parsed with react jsx
veauryVitePlugins({
type: 'react',
// Configuration of @vitejs/plugin-vue
// vueOptions: {...},
// Configuration of @vitejs/plugin-react
// reactOptions: {...},
// Configuration of @vitejs/plugin-vue-jsx
// vueJsxOptions: {...}
})
]
})
```
If you want to customize the compilation scope of vueJsx, you can configure overrides by setting type to `custom`.
```js
import { defineConfig } from 'vite'
// >= veaury@2.1.1
import veauryVitePlugins from 'veaury/vite/index.js'
export default defineConfig({
plugins: [
veauryVitePlugins({
type: 'custom',
// The jsx in .vue files and in the directory named 'vue_app' will be parsed with vue jsx.
vueJsxInclude: [/
没有合适的资源?快使用搜索试试~ 我知道了~
基于可逆计算原理从零开始构建的新一代低代码平台,致力于克服低代码平台无法摆脱穷举法困境,从理论层面有效解决粗粒度软件复用的问题
共1550个文件
ts:496个
js:285个
vue:265个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 125 浏览量
2024-04-04
09:32:55
上传
评论
收藏 10.32MB ZIP 举报
温馨提示
Nop平台是基于可逆计算原理从零开始构建的新一代低代码平台,它致力于克服低代码平台无法摆脱穷举法的困境,从理论层面有效的解决粗粒度软件复用的问题。nop-chaos是Nop平台的前端部分,基于Vue3.0、ant-design-vue、百度AMIS、logicflow、xspreadsheet等技术实现。
资源推荐
资源详情
资源评论
收起资源包目录
基于可逆计算原理从零开始构建的新一代低代码平台,致力于克服低代码平台无法摆脱穷举法困境,从理论层面有效解决粗粒度软件复用的问题 (1550个子文件)
.babelrc 101B
build.bat 0B
.eslintrc.cjs 666B
xspreadsheet.css 23KB
style.css 3KB
style.css 3KB
style.css 3KB
index.css 1KB
style.css 990B
designer.css 990B
App.css 840B
index.css 760B
index.css 679B
index.css 658B
style.css 635B
index.css 635B
fix.css 634B
index.css 609B
App.css 578B
index.css 528B
index.css 527B
index.css 527B
index.css 527B
index.css 527B
index.css 424B
index.css 366B
App.css 266B
style.css 254B
style.css 223B
style.css 114B
layout.css 83B
.env.development 793B
Dockerfile 1KB
.editorconfig 257B
.editorconfig 245B
.env 539B
.eslintignore 100B
.eslintignore 10B
.eslintignore 4B
.eslintignore 4B
.gitattributes 430B
.gitignore 369B
.gitignore 343B
.gitignore 275B
.gitignore 267B
.gitignore 258B
.gitignore 253B
.gitignore 253B
.gitignore 253B
.gitignore 253B
.gitignore 253B
.gitignore 206B
.gitignore 38B
index.html 7KB
index.html 4KB
index.html 4KB
index.html 3KB
demo.html 2KB
index.html 2KB
index.html 2KB
index.html 1KB
index.html 611B
index.html 366B
index.html 366B
index.html 362B
index.html 333B
index.html 14B
index.html 14B
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
bytedance.ico 2KB
favicon.ico 894B
pdf4.jpg 50KB
wechat-public-account.jpg 26KB
header.jpg 16KB
ts.worker.js 3.23MB
css.worker.js 2.89MB
sdk.js 886KB
sdk.js 886KB
html.worker.js 854KB
json.worker.js 482KB
nop-flow-builder.js 235KB
xspreadsheet.js 194KB
fix-react-json-view.js 165KB
fix-react-json-view.js 165KB
fix-react-json-view.js 165KB
editor.worker.js 136KB
nop-core.js 44KB
data_proxy.js 33KB
webpack.config.js 30KB
sheet.js 27KB
nop-amis-vue.js 27KB
applyReactInVue.js 25KB
applyVueInReact.js 15KB
cell_range_test.js 13KB
selector.js 10KB
table.js 10KB
row.js 9KB
draw.js 9KB
共 1550 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 7453
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功