无法为反应js中的按钮添加Tippy

问题描述 投票:0回答:1

我已经导入了下面的包,我试着参考下面的链接,我不知道在哪里放置tippy代码。请帮我。

https://atomiks.github.io/tippyjs/html-content

import React from 'react';
import ReactDom from 'react-dom';
import tippy from 'tippy.js';
import 'tippy.js/dist/tippy.css';

class Trial extentds Component {
    render(){
        return(
            <div>
                <Button onClick={this.submitTaggedFace} disabled={!this.validate()} variant="contained" color="primary"
                data-tippy="Tooltip"
                data-tippy-animation="scale"
                data-tippy-duration="0"
                data-tippy-arrow="true"
                data-tippy-delay="[800, 200]"
                >Click to Tag</Button>
            </div>
        )
    }
}
reactjs tippyjs
1个回答
1
投票

您的代码没有任何问题。您必须遗漏其他组件中的某些内容。

我创建了这个codesandbox示例:

https://codesandbox.io/s/5y8zm52own

© www.soinside.com 2019 - 2024. All rights reserved.