티스토리 뷰
클래스 conf
에서 속성을 선택 사항 으로 만들어야합니다 Tooltip
.
export class Tooltip implements TooltipConfig {
text:string;
label:string;
conf?:(any);
constructor(c:TooltipConfig) {
this.text = c.text;
this.label = c.label;
c.conf && (this.conf = c.conf);
}
}
또는 TooltipConfig
인터페이스의 tooltip
속성 유형으로 인터페이스 를 사용해야합니다 Section
.
export interface Section {
//...
digitalSkills?:{
skills?:{
name:string,
tooltip:TooltipConfig
}
}
또는 개체 생성에서 Tooltip 클래스를 인스턴스화 할 수 있습니다.
{
//...
digitalSkills: {
skills: [
{
name: '...',
tooltip: new Tooltip({
text: '...',
label: '...'
})
},
{
name: '...',
tooltip: new Tooltip({
text: '...',
label: '...'
})
}
],
//...
}
//...
}
이 샘플 코드를 살펴보십시오 .
출처
https://stackoverflow.com/questions/39915968
댓글