feat:span.title划过显示filePath

This commit is contained in:
shixiaohua 2024-02-06 17:08:41 +08:00
parent 8e07b42789
commit c58eca1d9a
1 changed files with 5 additions and 4 deletions

View File

@ -52,7 +52,7 @@ function generateChildList(fileList) {
} }
result.push({ result.push({
"key": filePath, "key": filePath,
"title": titleExtended(fileName,dirFlag), "title": titleExtended(fileName,dirFlag,filePath),
"icon": dirFlag ? <FolderOutlined/> : fileName.endsWith(".md") ? <FileMarkdownOutlined/> : <FileOutlined/>, "icon": dirFlag ? <FolderOutlined/> : fileName.endsWith(".md") ? <FileMarkdownOutlined/> : <FileOutlined/>,
"dirFlag": dirFlag, "dirFlag": dirFlag,
"children": childListM "children": childListM
@ -61,7 +61,7 @@ function generateChildList(fileList) {
return result; return result;
} }
const titleExtended = (fileName, dirFlag) => { const titleExtended = (fileName, dirFlag,filePath) => {
const confirm = (e) => { const confirm = (e) => {
console.log(e); console.log(e);
@ -71,7 +71,7 @@ const titleExtended = (fileName, dirFlag) => {
console.log(e); console.log(e);
message.error('Click on No'); message.error('Click on No');
}; };
return <span >{fileName} return <span title = {filePath}>{fileName}
{dirFlag && <span style={{float: "right"}}> {dirFlag && <span style={{float: "right"}}>
<Popconfirm <Popconfirm
title="更新当前目录" title="更新当前目录"
@ -114,7 +114,8 @@ const flushTree = (fileDirDate) => {
} }
defaultValueStateSet.push({ defaultValueStateSet.push({
"key": filePath, "key": filePath,
"title": titleExtended(fileName.substring(fileName.lastIndexOf("/")+1), dirFlag), //
"title": titleExtended(fileName.substring(fileName.lastIndexOf("/")+1), dirFlag,filePath),
"icon": <FolderOutlined/>, "icon": <FolderOutlined/>,
"dirFlag": dirFlag, "dirFlag": dirFlag,
"children": childListM "children": childListM