0

我正在尝试使用Tippy.js将工具提示绑定到我的组件中的一些 DOM 元素。

下面是我的基本示例test.component.ts,因为我什至无法显示它。

import ...
import { ViewChild, ElementRef } from @angular/core;
import tippy from 'tippy.js';

@Component({
selector: 'app-test',
template:
```
<div #testDiv>Hover over me.</div>
```,
styleUrls: []
})
export class TestComponent {
 @ViewChild('testDiv') testDiv: ElementRef;
 tippy(this.testDiv, { content: 'This is tooltip content.' })
}
4

0 回答 0