xxxx.ts
import { Component, Input, } from '@angular/core';
export interface Menu{
title:string,
acitie:boolean,
id:number
}
// @component是装饰器语法,把他下面的class装饰成一个ng的组件,
// 如果把@Component放到interface上面就装饰不上那个组件class了 就是组件类必须跟他的组件装饰器放一起
@Component({
selector: 'app-scrollable-tab',
templateUrl: './scrollable-tab.component.html',
styleUrls: ['./scrollable-tab.component.less']
})
export class ScrollableTabComponent{
@Input() title: string='';
@Input() menu: Menu[]=[];
constructor(){}
refresh(){}
add(){}
trackFun(index:any){
return index
}
}