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() f irs t: string;
@Prop() last: string;
@State() isVisible: boolean = true;
render() {
return (
<p>
Hello,my name is {this.f irs t} {this.last}
</p>
);
}
}
网站地址 : https://stenciljs.com/
GitHub: https://github.com/ionic-team/stencil
网站描述: 一个 简单的 Web 组件编译器
Stencil.js官方网站
官方网站: https://stenciljs.com/
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did175581