All Projects → DimaLiLongJi → InDiv

DimaLiLongJi / InDiv

Licence: MIT license
an angular like web mvvm framework.一个类 angular 前端框架。https://dimalilongji.github.io/InDiv

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
Less
1899 projects

Projects that are alternatives of or similar to InDiv

Seed
A Rust framework for creating web apps
Stars: ✭ 3,069 (+3387.5%)
Mutual labels:  web-framework, frontend-framework
Routing Controllers
Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage in Express / Koa using TypeScript and Routing Controllers Framework.
Stars: ✭ 3,557 (+3942.05%)
Mutual labels:  web-framework, typescript-framework
Core
🚀 The Node.js Framework highly focused on developer ergonomics, stability and confidence
Stars: ✭ 11,697 (+13192.05%)
Mutual labels:  web-framework, typescript-framework
phantom
👻 A reactive DOM rendering engine for building UIs.
Stars: ✭ 16 (-81.82%)
Mutual labels:  dom, frontend-framework
Displayjs
A simple JavaScript framework for building ambitious UIs 😊
Stars: ✭ 590 (+570.45%)
Mutual labels:  dom, frontend-framework
Binding.scala
Reactive data-binding for Scala
Stars: ✭ 1,539 (+1648.86%)
Mutual labels:  dom, web-framework
Drab
Remote controlled frontend framework for Phoenix.
Stars: ✭ 833 (+846.59%)
Mutual labels:  dom, web-framework
Squark
Rust frontend framework, for web browser and more.
Stars: ✭ 162 (+84.09%)
Mutual labels:  dom, frontend-framework
Browser Sec Whitepaper
Cure53 Browser Security White Paper
Stars: ✭ 251 (+185.23%)
Mutual labels:  dom
rocket
Light-weight web framework for Go
Stars: ✭ 26 (-70.45%)
Mutual labels:  web-framework
Skrape.it
A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. It aims to be a testing lib, but can also be used to scrape websites in a convenient fashion.
Stars: ✭ 231 (+162.5%)
Mutual labels:  dom
Mogwai
The minimalist, obvious, graphical, web application interface
Stars: ✭ 249 (+182.95%)
Mutual labels:  dom
farrow
A Type-Friendly Web Framework for Node.js
Stars: ✭ 748 (+750%)
Mutual labels:  web-framework
Lunasvg
A standalone c++ library to create, animate, manipulate and render SVG files.
Stars: ✭ 243 (+176.14%)
Mutual labels:  dom
string-dom
Create HTML strings using JSX (or functions).
Stars: ✭ 13 (-85.23%)
Mutual labels:  dom
Respo
A virtual DOM library built with ClojureScript, inspired by React and Reagent.
Stars: ✭ 230 (+161.36%)
Mutual labels:  dom
Pugixml
Light-weight, simple and fast XML parser for C++ with XPath support
Stars: ✭ 2,809 (+3092.05%)
Mutual labels:  dom
vuecket
Power of Vue.JS married with magic of Apache Wicket
Stars: ✭ 31 (-64.77%)
Mutual labels:  web-framework
dom-lite
A small DOM library for server-side testing, rendering, and handling of HTML files
Stars: ✭ 18 (-79.55%)
Mutual labels:  dom
poggit
GitHub application for managing PocketMine-family plugins, and website for sharing plugins.
Stars: ✭ 96 (+9.09%)
Mutual labels:  web-framework

关于 InDiv

本库版本对应 InDiv 2.0.5 + 版本(@indiv)文档 旧版本indiv v1.20 + 移至markdown

@indiv 2.0.5以下版本 已经废除,请使用 @indiv v2.0.5+

最新版本:v4.0.0

什么是InDiv

InDiv 是一个类 angular mvvm库

它能帮你构建 Web 应用。InDiv 集字符串模板、HTML模板、依赖注入和一些其他实践于一身。

InDiv 采用与 angular 类似的项目结构,提供相似的概念和 api 以减少学习成本。

  • InDiv 是单词 individual 的缩写,我撸它的时候借鉴了很多 angular,react,vue 的模式与概念
  • 本文档版本对应 InDiv 2.0.5 + 版本
  • 在此致敬 angular,react 和 vue的大佬开发者们。感谢他们为前端做出的巨大贡献

基本假设

  • 本文档假设你已经熟悉了 JavaScript,TypeScript,和来自最新标准的一些知识,比如 class 和 模块
  • 下列代码范例都是用最新版本的 TypeScript 写的,利用 类型 实现依赖注入,并使用装饰器来提供元数据

实现的angular装饰器

该项目创建的目的是为了学习下 angular 的架构,并尝试用自己的想法实现 angular 的一些装饰器和功能。

Demo

逻辑文件

import { InDiv, Component, AfterMount, ReceiveInputs, OnDestory, ElementRef, HasRender, Input, ContentChild, ContentChildren } from '@indiv/core';
import { HttpClient } from '@indiv/common';

import { TestContentComponent } from '@/test-content-component';
import { TestDirective } from '@/directives/test-directive';

@Component({
  selector: 'test-component',
  templateUrl: './template.html',
})
export class TestComponent implements OnDestory, ReceiveInputs, AfterMount, HasRender {
  @Input() public manName: string;

  public man: {name: string} = {
    name: 'ajiaxi',
  };

  @ContentChild('test-content-component') private testComponent: TestContentComponent;
  @ContentChild('a') private tagA: HTMLElement;
  @ContentChildren('test-directive') private testDirectiveString: TestDirective[];
  @ContentChildren('a') private tagAs: TestDirective[];
  @ContentChildren(TestDirective) private testDirective: TestDirective[];

  constructor(
    private httpClient: HttpClient,
    private indiv: InDiv,
    private element: ElementRef,
  ) {
    this.httpClient.get('/success').subscribe({
      next: (value: any) => { console.log('repsonse', value); },
    });
  }

  public click() {
    this.manName = 'li junhe';
  }

  public nvHasRender() {
    console.log('TestComponent HasRender', this.tagA, this.tagAs, this.testDirectiveString);
  }

  public nvAfterMount() {
    console.log('TestComponent AfterMount');
  }
  public nvOnDestory() {
    console.log('TestComponent OnDestory');
  }

  public nvReceiveInputs(p: any) {
    console.log('test-component nvReceiveInputs', p);
  }
}

模板

<!-- container: {{countState(color)}} -->
<div class="container" nv-class="test.b" nv-id="'cc'">
  <p>{{testNumber}}</p>
  <input nv-model="test.a" nv-on:click="show(test)" />
  <p test-directive="{test.a}" nv-id="232" nv-if="countState(a)" nv-on:click="changeInput()">{{a}}</p>
  <test-component nv-on:click="changeName(man)" nv-repeat="man in testArray" nv-key="man.name" manName="{countState(man.name)}" nv-if="a">
    <a>this is {{man.name}}</a>
    <test-content-component test-directive="{test.a}"></test-content-component>
  </test-component>
  <p nv-on:click="go()">
    <!-- container: {{countState(color)}} -->
    container: {{countState(color)}}
  </p>
  <input type="number" nv-model="a" />
  <div nv-repeat="man in testArray" nv-key="man.name">
    <div nv-on:click="show(testArray2, '你111')" nv-text="man.name"></div>
    <div>
      <p>性别:{{countState(man.sex, $index)}}</p>
    </div>
  </div>
  <router-render></router-render>
</div>

反馈

  • 你可以和我一起做贡献!你可以到 Github 上的仓库中提出文档方面的问题,并创建Pull Requests
  • 或者通过邮箱直接联系我:[email protected]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].