项目作者: LancerComet

项目描述 :
A simple, flex and strict UI library for TypeScripters.
高级语言: TypeScript
项目地址: git://github.com/LancerComet/LC.JS.git
创建时间: 2016-03-17T11:02:42Z
项目社区:https://github.com/LancerComet/LC.JS

开源协议:MIT License

下载


LC.JS

A simple, flex and strict UI library that in TypeScript.

Still under heavy construction.

Feature.

  • Components are first-class members.

  • No complex design, friendly to anyone.

  • For TypeScripters.

  • More is coming.

Quick start

  1. import { LC, Component } from 'lc.js'
  2. import { HelloWorld } from './hello-world'
  3. @Component({
  4. components: {
  5. 'hello-world': HelloWorld
  6. },
  7. template: `
  8. <div class="demo-app">
  9. <h1 :style="'color: ' + color">Hello, {{appName || '--'}}!</h1>
  10. <small>Version: {{version}}</small>
  11. <hello-world :app-name="appName"></hello-world>
  12. <div>
  13. <input @model="appName" place="Change your app name.">
  14. <input @model.number="version" @focus="onFocus">
  15. <button @click="showAppName">Show AppName</button>
  16. </div>
  17. </div>
  18. `
  19. })
  20. class AppRoot extends LC {
  21. appName: string = 'My App'
  22. color: string = '#2090e3'
  23. version: number = 10
  24. onFocus () {
  25. this.version = 0
  26. }
  27. showAppName () {
  28. alert(this.appName)
  29. }
  30. }
  31. const myApp = new AppRoot()
  32. myApp.$mount('#my-app')