baixiaoyu2997

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

  •  1
     
  •   baixiaoyu2997 · Jun 4, 2021 · 2807 views
    This topic created in 1816 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   ·   6044 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 466ea39e · 100ms · UTC 06:13 · PVG 14:13 · LAX 23:13 · JFK 02:13
    ♥ Do have faith in what you're doing.