mirror of https://gitee.com/answerdev/answer.git
refactor: Use useRenderHtmlPlugin
This commit is contained in:
parent
37eea9d9b3
commit
1100ec6145
|
@ -16,6 +16,7 @@ import {
|
|||
import { scrollToElementTop, bgFadeOut } from '@/utils';
|
||||
import { AnswerItem } from '@/common/interface';
|
||||
import { acceptanceAnswer } from '@/services';
|
||||
import { useRenderHtmlPlugin } from '@/utils/pluginKit';
|
||||
|
||||
interface Props {
|
||||
data: AnswerItem;
|
||||
|
@ -39,6 +40,8 @@ const Index: FC<Props> = ({
|
|||
});
|
||||
const [searchParams] = useSearchParams();
|
||||
const answerRef = useRef<HTMLDivElement>(null);
|
||||
useRenderHtmlPlugin(answerRef.current);
|
||||
|
||||
const acceptAnswer = () => {
|
||||
acceptanceAnswer({
|
||||
question_id: data.question_id,
|
||||
|
|
|
@ -16,6 +16,7 @@ import {
|
|||
modifyAnswer,
|
||||
useQueryRevisions,
|
||||
} from '@/services';
|
||||
import { useRenderHtmlPlugin } from '@/utils/pluginKit';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
|
@ -73,6 +74,7 @@ const Index = () => {
|
|||
});
|
||||
|
||||
const questionContentRef = useRef<HTMLDivElement>(null);
|
||||
useRenderHtmlPlugin(questionContentRef.current);
|
||||
|
||||
useEffect(() => {
|
||||
if (!questionContentRef?.current) {
|
||||
|
|
Loading…
Reference in New Issue