---wiki正式切换到vue3版本---

This commit is contained in:
暮光:城中城
2023-01-11 20:33:42 +08:00
parent bc28320565
commit b8068ef29e
115 changed files with 15723 additions and 40477 deletions

View File

@@ -0,0 +1,23 @@
export default {
createNavigationHeading() {
let headArr = []
let headNodeArr = document
.querySelector('.wiki-page-content')
.querySelectorAll('h1,h2,h3,h4,h5,h6')
if (headNodeArr.length <= 0) {
return []
}
headNodeArr.forEach((node) => {
let text = node.innerHTML
.replace(/^\s+/g, '')
.replace(/\s+$/g, '')
.replace(/<\/?[^>]+(>|$)/g, '')
headArr.push({
node: node,
level: parseInt(node.tagName.replace(/[h]/i, ''), 10),
text: text,
})
})
return headArr
},
}

View File

@@ -0,0 +1,24 @@
export default {
computeFileSize(fileSize) {
if (!fileSize) {
return '-'
}
let size = ''
if (fileSize < 0.1 * 1024) {
size = fileSize.toFixed(2) + 'B'
} else if (fileSize < 0.1 * 1024 * 1024) {
size = (fileSize / 1024).toFixed(2) + 'KB'
} else if (fileSize < 0.1 * 1024 * 1024 * 1024) {
size = (fileSize / (1024 * 1024)).toFixed(2) + 'MB'
} else {
size = (fileSize / (1024 * 1024 * 1024)).toFixed(2) + 'GB'
}
let sizeStr = size + ''
let index = sizeStr.indexOf('.')
let dou = sizeStr.substr(index + 1, 2)
if (dou == '00') {
return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2)
}
return size
},
}

View File

@@ -0,0 +1,46 @@
/**展示内容的样式*/
.wang-editor-body {
font-size: 14px;
padding: 6px;
overflow-y: auto;
}
.wang-editor-body table {
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
}
.wang-editor-body table td, .wang-editor-body table th {
border-bottom: 1px solid #ccc;
border-right: 1px solid #ccc;
padding: 3px 5px;
}
.wang-editor-body table th {
border-bottom: 2px solid #ccc;
text-align: center;
}
.wang-editor-body blockquote {
display: block;
border-left: 8px solid #d0e5f2;
padding: 5px 10px;
margin: 10px 0;
line-height: 1.4;
font-size: 100%;
background-color: #f1f1f1;
}
.wang-editor-body code {
display: inline-block;
*display: inline;
*zoom: 1;
background-color: #f1f1f1;
border-radius: 3px;
padding: 3px 5px;
margin: 0 3px;
}
.wang-editor-body pre code {
display: block;
}