爱意满满的作品展示区。
IntPtr

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

  •  
  •   IntPtr ·
    lixiaoyan · Jun 24, 2015 · 3202 views
    This topic created in 3979 days ago, the information mentioned may be changed or developed.

    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 replies    2015-06-26 17:54:05 +08:00
    visonme
        1
    visonme  
       Jun 25, 2015
    为楼主赞一个,或许生产中不会使用到楼主的,但是应用中一些确实可以借鉴的
    +1
    jinzhe
        2
    jinzhe  
       Jun 26, 2015
    感觉比原生还复杂
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3044 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 09:40 · PVG 17:40 · LAX 02:40 · JFK 05:40
    ♥ Do have faith in what you're doing.