我正在编写自己的弹出框组件,它将进行一些文本转换 https://pastecord.com/vegygawece.js。 <--- Popover component code It should work like this:
import { Flex, Text } from "@chakra-ui/react";
import Popover from "../../components/popover";
function ResumeEditor() {
return (
<Flex bg="lightgrey" width="100%" height="100vh">
<Text>
this is an editorthis is an editorthis is an editorthis is an editorthis
is an editorthis is an editorthis is an editorthis is an editorthis is
an editorthis is an editorthis is an editorthis is an editorthis is an
editorthis is an editorthis is an editorthis is an editorthis is an
editorthis is an editorthis is an editorthis is an editor
</Text>
<Popover
onTextSelect={() => {
return;
}}
/>
</Flex>
);
}
export default ResumeEditor;
您似乎正在使用 ChakraUI,因此您可以使用 ChakraUI 中的 ToolTip 组件。否则,如果您想使用纯 HTML 来实现它,您可以使用 title 标签。