修改顶部nav访问新闻详情定位不准确

master
JayChou 2 weeks ago
parent 638495607d
commit 52865cb8cf
  1. 1
      jeecgboot-vue3/src/views/demo/main-home/components/NewsList/index.vue
  2. 1
      jeecgboot-vue3/src/views/demo/main-home/components/articleManagement/index.vue
  3. 1
      jeecgboot-vue3/src/views/demo/main-home/components/columnManagement/index.vue
  4. 9
      jeecgboot-vue3/src/views/demo/main-home/components/homePage/index.vue
  5. 10
      jeecgboot-vue3/src/views/demo/main-home/components/newsInfo/index.vue

@ -100,6 +100,7 @@
path: '/main-home/newsInfo',
query: {
id: item.id,
type:1
},
});
};

@ -90,6 +90,7 @@
path: '/main-home/newsInfo',
query: {
id: item.id,
type:3
},
})
}

@ -91,6 +91,7 @@
path: '/main-home/newsInfo',
query: {
id: item.id,
type:2
},
})
}

@ -41,7 +41,7 @@
</div>
<div class="inner">
<ul>
<li v-for="item in noticeList" :key="item.id" @click="goToNewInfo(item)">{{ item.title }}</li>
<li v-for="item in noticeList" :key="item.id" @click="goToNewInfo(item,2)">{{ item.title }}</li>
</ul>
</div>
</div>
@ -57,7 +57,7 @@
</div>
<div class="inner">
<ul>
<li v-for="item in newList" :key="item.id" @click="goToNewInfo(item)">{{ item.title }}</li>
<li v-for="item in newList" :key="item.id" @click="goToNewInfo(item,1)">{{ item.title }}</li>
</ul>
</div>
</div>
@ -68,7 +68,7 @@
</div>
<div class="inner">
<ul>
<li v-for="item in gzdtList" :key="item.id" @click="goToNewInfo(item)">{{ item.title }}</li>
<li v-for="item in gzdtList" :key="item.id" @click="goToNewInfo(item,3)">{{ item.title }}</li>
</ul>
</div>
</div>
@ -150,11 +150,12 @@
const goToNewList = () => {
router.push('/main-home/newsList');
};
const goToNewInfo = (item) => {
const goToNewInfo = (item,type=1) => {
router.push({
path: '/main-home/newsInfo',
query: {
id: item.id,
type:type
},
});
};

@ -28,6 +28,8 @@
import {getindexarticleitem} from '@/api/mainHome'
import { useRoute,useRouter } from 'vue-router';
import { ref } from 'vue';
import { useSettingStore } from '/@/store/modules/setting';
const settingStore = useSettingStore();
const route = useRoute()
const router = useRouter()
const id = route.query.id
@ -43,6 +45,14 @@ const getInfo = async () => {
info.value = res[0]
}
getInfo()
if(Object.keys(route.query).length > 1 && route.query.type == 2) {
console.log('设置');
settingStore.serIndex(5)
}else if(Object.keys(route.query).length > 1 && route.query.type == 3) {
settingStore.serIndex(6)
}
</script>
<style scoped lang="less">

Loading…
Cancel
Save