vue组件:xxx.vue
react组件:xxx.js+xxx.css
angular组件:xxx.ts+xxx.css+xxx.html
@ngmodule:angular的一个模块化。装饰angular的app.module.ts文件内的appmodule类。
参数: declarations:注册组件的地方 imports:注册项目用到的核心功能模块 providers:注册相关服务的 bootstrap:指定页面上初始渲染的组件
@component({ selector: 'app-root', //组件的名字 templateurl: './app.component.html',//当前组件的html模板 styleurls: ['./app.component.css'] //当前组件的样式 })
export class appcomponent { title = 'angularpro'; //类的属性 }
通过@component这个装饰器,将appcomponent类装饰为一个组件。
vue和react和angular的html模板的区别:
vue和react必须要有一个根节点,但angular不需要根节点。
如对本文有疑问, 点击进行留言回复!!
网友评论