Stencil.js
Stencil.js 介绍
Stencil 是一个简单的 Web 组件编译器。它结合了流行框架的设计理念,通过使用 Type、jsX、虚拟 DOM,reactive 数据绑定和异步渲染(类似于 react Fiber)来生成 Web 组件。
Stencil.js例子:
import { Component,Prop,State } from '@stencil/core';
@Component({
tag: 'my-component',
styleUrl: 'my-component.scss'
})
export class MyComponent {
// Indicate that name should be a property on our new component
@Prop() first: string;
@Prop() last: string;
@State() isVisible: boolean = true;
render() {
return (
<p>
Hello,my name is {this.first} {this.last}
</p>
);
}
}
GitHub:https://github.com/ionic-team/stencil
网站描述:一个简单的 Web 组件编译器