This commit is contained in:
pplokijuhyg 2019-11-29 21:32:02 +08:00
parent 80ef5bbfcc
commit 71fb824b9c
4 changed files with 19 additions and 12 deletions

View File

@ -29,7 +29,7 @@
<follow v-if="item.status == 3 " :operation="type[item.type] + '了该' + status[item.status]" :day="item.time + '前'" :title="item.title" :nickname="item.nickname" :userimg="'http://lawpro.earnest.pro' + item.img" :num="item.islike" :img="'http://lawpro.earnest.pro' + item.avatar" :text="item.text" :comment="item.comment"></follow> <follow v-if="item.status == 3 " :operation="type[item.type] + '了该' + status[item.status]" :day="item.time + '前'" :title="item.title" :nickname="item.nickname" :userimg="'http://lawpro.earnest.pro' + item.img" :num="item.islike" :img="'http://lawpro.earnest.pro' + item.avatar" :text="item.text" :comment="item.comment"></follow>
<answer v-if="item.status == 1 || item.status == 2" :operation="type[item.type] + '了该' + status[item.status]" :day="item.time + '前'" :title="item.title" :types="item.status" :id="item.id"></answer> <answer v-if="item.status == 1 || item.status == 2" :operation="type[item.type] + '了该' + status[item.status]" :day="item.time + '前'" :title="item.title" :types="item.status" :id="item.id"></answer>
<follow v-if="types == 3" operation="发布了该回答" :day="item.time" :title="item.title" :nickname="item.nickname" :userimg="'http://lawpro.earnest.pro' + userimg" :num="item.islike" :img="'http://lawpro.earnest.pro' + item.avatar" :text="item.text" :comment="item.comment"></follow> <follow v-if="types == 3" operation="发布了该回答" :day="item.time" :title="item.title" :nickname="item.nickname" :userimg="'http://lawpro.earnest.pro' + userimg" :num="item.islike" :img="'http://lawpro.earnest.pro' + item.avatar" :text="item.text" :comment="item.comment"></follow>
<answer v-if="types==1" operation="发布了该文章" :day="item.time" :title="item.title" types="1" :id="item.id"></answer> <answer @wz="wzs" v-if="types==1" operation="发布了该文章" :day="item.time" :title="item.title" types="1" :id="item.id"></answer>
<answer v-if="types==2" operation="发布了该问题" :day="item.time" :title="item.title" types="2" :id="item.id"></answer> <answer v-if="types==2" operation="发布了该问题" :day="item.time" :title="item.title" types="2" :id="item.id"></answer>
</div> </div>
@ -117,6 +117,7 @@
import follow from "./components/PersonafFollow" import follow from "./components/PersonafFollow"
// import follows from "./components/PersonafFollows" // import follows from "./components/PersonafFollows"
import answer from "./components/PersonalAnswer" import answer from "./components/PersonalAnswer"
// import { log } from 'util';
export default { export default {
name: "Personal-homepage", name: "Personal-homepage",
data() { data() {
@ -138,6 +139,14 @@ export default {
answer answer
}, },
methods:{ methods:{
wzs(){
// console.log(a,b,12)
// this.$router.replace('/')
this.$router.push({
path:'/articledetail'
})
},
getlist(){ getlist(){
if(this.lock){ if(this.lock){
return ; return ;

View File

@ -37,13 +37,10 @@ export default {
methods:{ methods:{
tab(){ tab(){
window.console.log(this.types,"llk") window.console.log(this.types,"llk")
if(this.types=="1"){ this.$emit("wz",this.types,this.id)
this.$router.push({
path: '/sign'
});
window.console.log( this.$router) window.console.log( this.$router)
} }
} }
}
}; };
</script> </script>

View File

@ -124,17 +124,17 @@ export default {
switch (e) { switch (e) {
case 0: case 0:
this.$router.push({ this.$router.push({
path: `/index` path: '/'
}); });
break; break;
case 1: case 1:
this.$router.push({ this.$router.push({
path: `/PersonalHomepage` path: '/PersonalHomepage'
}); });
break; break;
case 2: case 2:
this.$router.push({ this.$router.push({
path: `/login` path: '/login'
}); });
break; break;
} }

View File

@ -2,7 +2,6 @@ import Vue from 'vue'
//1.导入路由组件vue-router //1.导入路由组件vue-router
import Router from 'vue-router' import Router from 'vue-router'
//2.调用vue-router //2.调用vue-router
Vue.use(Router)
import PersonalHomepage from "./PersonalHomepage" import PersonalHomepage from "./PersonalHomepage"
import index from "./index" import index from "./index"
// import PersonalHomepage from "./PersonalHomepage" // import PersonalHomepage from "./PersonalHomepage"
@ -16,8 +15,10 @@ import IndexReport1 from "./IndexReport1"
import IndexReport2 from "./IndexReport2" import IndexReport2 from "./IndexReport2"
import Answer from "./Answer" import Answer from "./Answer"
import sign from "./sign" import sign from "./sign"
import ArticleDetail from "./articledetail" import ArticleDetail from "./articledetail.vue"
Vue.use(Router)
const router=new Router({ const router=new Router({
mode:'history',
routes: [ routes: [
{ {
path: '/articledetail', path: '/articledetail',
@ -52,7 +53,7 @@ const router=new Router({
component: login component: login
}, },
{ {
path: '/index', path: '/',
component: index component: index
}, },
{ {