扫一扫分享
Stencil 是一个简单的 Web 组件编译器。它结合了流行框架的设计理念,通过使用 Type、JSX、虚拟 dom,reactive 数据绑定和异步渲染(类似于 React Fiber)来生成 Web 组件。
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>
);
}
}
仅供个人学习参考/导航指引使用,具体请以第三方网站说明为准,本站不提供任何专业建议。如果地址失效或描述有误,请联系站长反馈~感谢您的理解与支持!
手机预览