article默认展开修改

This commit is contained in:
qsc 2023-07-11 10:10:11 +08:00
parent f816023411
commit 67d767cb00
4 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ function render(props) {
var _b = props.methods, t = _b.t, gotoArticleUpsert = _b.gotoArticleUpsert, getOpenKeys = _b.getOpenKeys, loadArticles = _b.loadArticles, findFirstArticle = _b.findFirstArticle;
var _c = tslib_1.__read((0, react_1.useState)(false), 2), executed = _c[0], setExecuted = _c[1];
(0, react_1.useEffect)(function () {
if (!executed && treeData.length > 0) {
if (!executed && treeData.length > 0 && openKeys.length === 0) {
var node = findFirstArticle(treeData);
getOpenKeys(node.key, treeData, openKeys);
setExecuted(true);

View File

@ -15,7 +15,7 @@ function render(props) {
var features = (0, useFeatures_1.default)();
var _c = tslib_1.__read((0, react_1.useState)(false), 2), executed = _c[0], setExecuted = _c[1];
(0, react_1.useEffect)(function () {
if (!executed && treeData.length > 0) {
if (!executed && treeData.length > 0 && openKeys.length === 0) {
var node = findFirstArticle(treeData);
getOpenKeys(node.key, treeData, openKeys);
setExecuted(true);

View File

@ -71,7 +71,7 @@ export default function render(
} = props.methods;
const [executed, setExecuted] = useState(false);
useEffect(() => {
if (!executed && treeData.length > 0) {
if (!executed && treeData.length > 0 && openKeys.length === 0) {
const node = findFirstArticle(treeData);
getOpenKeys(node.key,treeData,openKeys)
setExecuted(true);

View File

@ -77,7 +77,7 @@ export default function render(
const features = useFeatures();
const [executed, setExecuted] = useState(false);
useEffect(() => {
if (!executed && treeData.length > 0) {
if (!executed && treeData.length > 0 && openKeys.length === 0) {
const node = findFirstArticle(treeData);
getOpenKeys(node.key, treeData, openKeys);
setExecuted(true);