@@ -99,6 +99,7 @@ export default {
const route = useRoute()
const postId = route.params.id
+ const title = ref('')
const postContent = ref('')
const tags = ref([])
const comments = ref([])
@@ -122,6 +123,7 @@ export default {
if (!res.ok) return
const data = await res.json()
postContent.value = data.content
+ title.value = data.title
tags.value = data.tags || []
comments.value = (data.comments || []).map(mapComment)
postTime.value = new Date(data.createdAt).toLocaleDateString('zh-CN', { month: 'numeric', day: 'numeric' })
@@ -198,6 +200,7 @@ export default {
return {
postContent,
+ title,
tags,
comments,
postTime,
@@ -211,6 +214,7 @@ export default {
onScroll: updateCurrentIndex,
copyPostLink,
renderMarkdown
+ }
}
}
@@ -456,6 +460,4 @@ export default {
.copy-link:hover {
background-color: #e2e2e2;
}
-
-
diff --git a/open-isle-cli/vue.config.js b/open-isle-cli/vue.config.js
index 910e297e0..69b45b781 100644
--- a/open-isle-cli/vue.config.js
+++ b/open-isle-cli/vue.config.js
@@ -1,4 +1,7 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
- transpileDependencies: true
+ transpileDependencies: true,
+ configureWebpack: {
+ devtool: 'source-map'
+ },
})
diff --git a/package-lock.json b/package-lock.json
index f455572f2..5165375a5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2,5 +2,17 @@
"name": "OpenIsle",
"lockfileVersion": 3,
"requires": true,
- "packages": {}
+ "packages": {
+ "": {
+ "dependencies": {
+ "ldrs": "^1.1.7"
+ }
+ },
+ "node_modules/ldrs": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/ldrs/-/ldrs-1.1.7.tgz",
+ "integrity": "sha512-rZnfveeY1SeS3F3ifUVd9AVGTFHmQ0qzp5fuszAirnrVkjqJBLrm99vtr/Mxbby4XgadUYv+DsFqyk2p4FV40Q==",
+ "license": "MIT"
+ }
+ }
}
diff --git a/package.json b/package.json
new file mode 100644
index 000000000..c79ceca0e
--- /dev/null
+++ b/package.json
@@ -0,0 +1,5 @@
+{
+ "dependencies": {
+ "ldrs": "^1.1.7"
+ }
+}