V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
IntPtr
V2EX  ›  分享创造

X-View - 一个基于 Virtual DOM 与 Web Components 的前端框架.

  •  
  •   IntPtr ·
    lixiaoyan · 2015-06-24 20:36:02 +08:00 · 2447 次点击
    这是一个创建于 3240 天前的主题,其中的信息可能已经有所发展或是发生改变。

    https://github.com/lixiaoyan/x-view

    一个有意义的轮子(伪), 三天写出来的产物, 仿 React 的 API.

    一个 example:

    var Button = x.createClass({
      propTypes: {
        text: x.type.string
      },
      render: function() {
        return x.createElement("button", {
          "on-click": this.emit.bind(this, "button-click")
        }, [this.props.text]);
      }
    });
    x.register("x-button", Button);
    x.render(document.body, x.createElement("x-button", {
      text: "Hello!",
      "on-button-click": function() {
        console.log("You clicked the button.");
      }
    }));
    

    目前还不稳定, 只是刚能用了而已, Shadow DOM 支持正在开发中...

    2 条回复    2015-06-26 17:54:05 +08:00
    visonme
        1
    visonme  
       2015-06-25 14:01:12 +08:00
    为楼主赞一个,或许生产中不会使用到楼主的,但是应用中一些确实可以借鉴的
    +1
    jinzhe
        2
    jinzhe  
       2015-06-26 17:54:05 +08:00
    感觉比原生还复杂
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   971 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 21:17 · PVG 05:17 · LAX 14:17 · JFK 17:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.