baixiaoyu2997

有什么办法可以一个组件同时在 react 和 vue 中使用?

  •  1
     
  •   baixiaoyu2997 · Jun 4, 2021 · 3254 views
    This topic created in 1991 days ago, the information mentioned may be changed or developed.
    目前想到的方向是 web component,不知道有没有成熟的库去做这个事情
    7 replies  •  2021-06-04 13:11:19 +08:00
    murmur
    murmur
    Jun 4, 2021
    1
    可以啊,做成不依赖任何框架的纯 js 模块就可以了,然后外面套一层封装,交互少的连封装都不需要
    66beta
    66beta
    Jun 4, 2021
    2
    当然可以了,你甚至可以找一个 mini 版的 mvvm 框架嵌在你的组件里面
    jymsy
    jymsy
    Jun 4, 2021
    4
    封一个 npm 包不就完了么
    diliburong
    diliburong
    Jun 4, 2021
    5
    web component, 库有 polymer 和 LitElement.
    https://polymer-library.polymer-project.org/
    ryougifujino
    ryougifujino
    Jun 4, 2021
    6
    使用 Svelte 编译到 Web Component,然后 React 或 Vue 项目中引入使用。
    dotnet
    dotnet
    Jun 4, 2021
    7
    看微软的这个, 也是 web component
    https://www.fast.design/docs/integrations/introduction
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2381 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 00:16 · PVG 08:16 · LAX 16:16 · JFK 19:16
    ♥ Do have faith in what you're doing.