티스토리 뷰

클래스 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
댓글
공지사항
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31