|
@@ -1,5 +1,5 @@
|
|
|
import './index.less'
|
|
|
-import React, { useState } from "react";
|
|
|
+import React, { useEffect, useState } from "react";
|
|
|
import Item from 'antd/lib/list/Item';
|
|
|
import api from '~/api'
|
|
|
export const Marked: React.FC = (props: any) => {
|
|
@@ -411,9 +411,12 @@ export const Marked: React.FC = (props: any) => {
|
|
|
])
|
|
|
let query = new URLSearchParams(window.location.search)
|
|
|
let name = query.get('markdown')
|
|
|
- api.markdown(name || '').then(res => {
|
|
|
- setJsonData(res.data.data)
|
|
|
- })
|
|
|
+ useEffect(()=>{
|
|
|
+ api.markdown(name || '').then(res => {
|
|
|
+ setJsonData(res.data.data)
|
|
|
+ })
|
|
|
+ },[])
|
|
|
+
|
|
|
return (
|
|
|
<div id="marked">
|
|
|
{jsonData.map((oneLevel, index0) => {
|