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 组件编译器
Stencil.js
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。