Git Product home page Git Product logo

zhnjsbox's Introduction

图片名称

0x0 描述

钟大的JSBox了解一下。核心其实就是一个动态化的框架,区别于一些DSL的页面动态化。js动态化做到了逻辑也能动态化。我这边实现了一个乞丐版的JSBox。基础的视图显示功能都已经加上,整体项目的架构已经搭建完成,如有需要稍微加加功能改改就能直接用。

实现的一些细节可以查看我在掘金上的文章 https://juejin.im/post/5b1a21bb5188254fbb756b23

按我自己的理解,这样的引擎或者说方案其实可以说是破产版的weex(是不是听起来很唬人😀)。相比于一些歪门邪道的DSL动态化方案,我觉得通过JS来做才是正途。

0x1 示例JS页面代码

$ui.render({
  views: [
    {
      type: "view",
      props: {
        bgcolor: $color("#FF0000")
      },
      layout: function(make, view) {
        make.center.equalTo(view.super)
        make.size.equalTo($size(100, 100))
      },
      events: {
        tapped: function(sender) {

        }
      }
    }
  ]
})

0x2 功能

  • JavaScript to native页面
  • 代码编辑器(支持代码高亮)

zhnjsbox's People

Contributors

zhnnnnn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.