This commit is contained in:
username 2024-06-23 21:14:56 +08:00
parent 14c8964a0c
commit ac2dea81d6
8 changed files with 66 additions and 102 deletions

35
package-lock.json generated
View File

@ -15,10 +15,6 @@
"dayjs": "^1.11.10",
"element-ui": "^2.15.14",
"masonry-layout": "^4.2.2",
"quill": "^1.3.7",
"quill-image-drop-module": "^1.0.3",
"quill-image-extend-module": "^1.1.2",
"quill-image-resize-module": "^3.0.0",
"vue": "^2.6.14",
"vue-lazyload": "^3.0.0",
"vue-quill-editor": "^3.0.6",
@ -8981,7 +8977,8 @@
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"node_modules/lodash.camelcase": {
"version": "4.3.0",
@ -11178,29 +11175,6 @@
"node": ">=0.10"
}
},
"node_modules/quill-image-drop-module": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/quill-image-drop-module/-/quill-image-drop-module-1.0.3.tgz",
"integrity": "sha512-HP0Y2kb3nQk1QbRKZzEe1j3mArRQerN5B/U/MlXrOnxmhy3m/xYmVv0YoE13vWnGnBOIcoXGJ/9fi7l6AwsP8Q==",
"dependencies": {
"quill": "^1.2.2"
}
},
"node_modules/quill-image-extend-module": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/quill-image-extend-module/-/quill-image-extend-module-1.1.2.tgz",
"integrity": "sha512-yHJWZWlTjNZzV34zuT4H55ttDwMxmVJ7JUgKnt/Wd3ejUNcaPOV57/sKG8VEMU5mL7bKZPIKmBdb3weM0M5UeA=="
},
"node_modules/quill-image-resize-module": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/quill-image-resize-module/-/quill-image-resize-module-3.0.0.tgz",
"integrity": "sha512-1TZBnUxU/WIx5dPyVjQ9yN7C6mLZSp04HyWBEMqT320DIq4MW4JgzlOPDZX5ZpBM3bU6sacU4kTLUc8VgYQZYw==",
"dependencies": {
"lodash": "^4.17.4",
"quill": "^1.2.2",
"raw-loader": "^0.5.1"
}
},
"node_modules/quill/node_modules/clone": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
@ -11256,11 +11230,6 @@
"node": ">= 0.8"
}
},
"node_modules/raw-loader": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz",
"integrity": "sha512-sf7oGoLuaYAScB4VGr0tzetsYlS8EJH6qnTCfQ/WVEa89hALQ4RQfCKt5xCyPQKPDUbVUAIP1QsxAwfAjlDp7Q=="
},
"node_modules/read-pkg": {
"version": "5.2.0",
"resolved": "https://registry.npmmirror.com/read-pkg/-/read-pkg-5.2.0.tgz",

View File

@ -15,10 +15,6 @@
"dayjs": "^1.11.10",
"element-ui": "^2.15.14",
"masonry-layout": "^4.2.2",
"quill": "^1.3.7",
"quill-image-drop-module": "^1.0.3",
"quill-image-extend-module": "^1.1.2",
"quill-image-resize-module": "^3.0.0",
"vue": "^2.6.14",
"vue-lazyload": "^3.0.0",
"vue-quill-editor": "^3.0.6",

View File

@ -1,13 +1,13 @@
<template>
<div id="app">
<main>
<router-view />
<trigger></trigger>
<el-backtop :right="100" :bottom="100" />
</main>
<footer>
<basePage></basePage>
</footer>
<main>
<router-view />
<trigger></trigger>
<el-backtop :right="100" :bottom="100" />
</main>
<footer>
<basePage></basePage>
</footer>
</div>
</template>
@ -17,9 +17,7 @@ import basePage from './components/base.vue'
export default {
data () {
return {
}
return {}
},
components: {
trigger,
@ -29,5 +27,4 @@ export default {
</script>
<style lang="less">
</style>

View File

@ -1,5 +1,6 @@
import axios from 'axios'
// 舔狗日记
export const fetchUser = () => {
return axios.get('https://api.oioweb.cn/api/SimpWords')
}

View File

@ -0,0 +1,40 @@
.detail-page {
padding: 20px;
max-width: 800px;
margin: 0 auto;
background-color: #f9f9f9;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.detail-page h1 {
font-size: 2em;
margin-bottom: 20px;
text-align: center;
color: #333;
}
.content-wrapper {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.content-wrapper h2 {
font-size: 1.5em;
margin-bottom: 15px;
color: #444;
}
.content {
font-size: 1em;
line-height: 1.6;
color: #666;
}
.loading {
font-size: 1.2em;
text-align: center;
color: #999;
}

View File

@ -20,6 +20,7 @@ export default {
.not-found {
text-align: center;
margin-top: 100px;
height: 100vh;
}
h1 {

View File

@ -7,8 +7,8 @@
<div class="content-left" v-for="(item, index) in contList" :key="index">
<div class="con-title-left">
<img :src="item.img" />
<h3>
<router-link to="/">{{ item.title }}</router-link>
<h3 @click="pushDetailPage(item)">
{{ item.title }}
</h3>
</div>
</div>
@ -31,7 +31,7 @@
</div>
</div>
<div class="popular-articles">
<h3>热门文章</h3>
<h3>今日天气</h3>
<ul>
<li v-for="(article, index) in popularArticles" :key="index">
<router-link to="/">{{ article.title }}</router-link>
@ -90,7 +90,15 @@ export default {
methods: {
fetchTags () {
getlist().then(res => {
this.contList = res.data
this.contList = res.data.slice(0, 10)
})
},
pushDetailPage (item) {
this.$router.push({
name: 'detailPage',
params: {
selectedItem: item //
}
})
}
}

View File

@ -24,58 +24,10 @@ export default {
},
created () {
this.selectedItem = this.$route.params.selectedItem //
if (this.selectedItem) {
localStorage.setItem('selectedItem', JSON.stringify(this.selectedItem))
} else {
const savedItem = localStorage.getItem('selectedItem')
if (savedItem) {
this.selectedItem = JSON.parse(savedItem)
}
}
}
}
</script>
<style scoped>
.detail-page {
padding: 20px;
max-width: 800px;
margin: 0 auto;
background-color: #f9f9f9;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.detail-page h1 {
font-size: 2em;
margin-bottom: 20px;
text-align: center;
color: #333;
}
.content-wrapper {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.content-wrapper h2 {
font-size: 1.5em;
margin-bottom: 15px;
color: #444;
}
.content {
font-size: 1em;
line-height: 1.6;
color: #666;
}
.loading {
font-size: 1.2em;
text-align: center;
color: #999;
}
@import url('../../assets/styles/Detail.css');
</style>