Giter Club home page Giter Club logo

rubic's Introduction

Rubic logo

npm package build status Coverage Status

Rubic

Rubic 是一个轻量级的小程序运行时框架,它继承 Vue3 的设计思路,并提供了与 Vue 一致的编程模型(组合式 API + 响应式 API)。它专注于 javascript 逻辑部分,为小程序提供更好的逻辑复用以及更灵活的代码组织能力。

官方文档

特性

  • 响应性:基于 @vue/reactivity 的响应式能力。
  • 组合式:与 vue3 一致的 Composition API 来描述组件逻辑。
  • 类型化:灵活的 API 和完整的 TypeScript 类型。
  • 轻量级:仅 30KB 的体积,无编译依赖,现有小程序可轻松接入。

示例:

import { definePage, ref, computed } from 'Rubic'

definePage({
  setup(query, ctx) {
    const count = ref(0)
    const double = computed(() => count.value * 2)

    const increment = () => {
      count.value++
    }
    return {
      count,
      double,
      increment,
    }
  },
})
<view bindtap="increment">{{count}} x2:{{double}}</view>

rubic's People

Contributors

jaskang 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.