V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
baixiaoyu2997

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

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