vue에서 Dashboard를 누르면 다른 내용이 같은 표로 이동하는 실례
페이지 내용 클릭: 우선 순위
페이지 내용: 상태 클릭
echarts 기둥 모양 클릭
this.chartEvent.on('click',function (param) {
that.$router.push({
path: '/cases/case',
query: { createdTime: param.name,type:"createdTime" }
});
})
2. 표 페이지 나누기 쓰기주: 이 페이지 밑에 있는 상자도 상응하는 우선순위 선별 조건이 있기 때문에 두 겹으로 썼습니다.
getData: function(){
// CaseSearch
eventBus.$on('ticketEntityId',function(val){
tableCaseVue.ticketEntityId=val;
})
eventBus.$on('companyId',function(val){
tableCaseVue.companyId=val;
})
eventBus.$on('priorityId',function(val){
tableCaseVue.priorityId=val;
})
eventBus.$on('status',function(val){
tableCaseVue.status=val;
})
eventBus.$on('ticketCategory',function(val){
tableCaseVue.ticketCategory=val;
})
var pageTicketDate = {
"pageNum": this.current,
"pageSize": this.pageSize,
"priorityId":tableCaseVue.priorityId,
"status":tableCaseVue.status,
"ticketEntityId":tableCaseVue.ticketEntityId,
"companyId":tableCaseVue.companyId,
"ticketCategory":tableCaseVue.ticketCategory
};
//
if((this.$route.query.type == 'priorityId')&&(pageTicketDate.priorityId=='')){
pageTicketDate.priorityId=this.$route.query.priorityId;
}
//
if((this.$route.query.type == 'status')&&(pageTicketDate.status=='')){
pageTicketDate.status=this.$route.query.status;
}
//
if (this.$route.query.type == 'createdTime') {
pageTicketDate.createdTime = this.$route.query.createdTime;
}
//
if (this.$route.query.type == 'currentMonth') {
pageTicketDate.currentMonth = this.$route.query.currentMonth;
}
if(pageTicketDate.ticketEntityId||pageTicketDate.companyId||pageTicketDate.priorityId||pageTicketDate.status||pageTicketDate.ticketCategory){
pageTicketDate.ticketEntityId=tableCaseVue.ticketEntityId;
pageTicketDate.companyId=tableCaseVue.companyId;
pageTicketDate.priorityId=tableCaseVue.priorityId;
pageTicketDate.status=tableCaseVue.status;
pageTicketDate.ticketCategory=tableCaseVue.ticketCategory;
pageTicketDate.createdTime='';
pageTicketDate.currentMonth='';
}
this.$api.ticket.pageTicket(pageTicketDate)
.then(res => {
this.tableCaseDate = res.data.records;
for(var i=0;i<this.tableCaseDate.length;i++){
//
if(this.tableCaseDate[i].waitTime!=undefined){
this.tableCaseDate[i].waitTime=this.tableCaseDate[i].waitTime+' ';
}
//
if(this.tableCaseDate[i].handleTime!=undefined){
this.tableCaseDate[i].handleTime=this.tableCaseDate[i].handleTime+' ';
}
//
if(this.tableCaseDate[i].finishTime!=undefined){
this.tableCaseDate[i].finishTime=this.tableCaseDate[i].finishTime;
}else{
this.tableCaseDate[i].finishTime='N/A';
}
}
//
this.current = res.data.current;
//
this.dataTotal = res.data.total;
});
}
보충 지식: vue 클릭 세부 정보 페이지로 이동1 상품 구성 요소 페이지 Goods Info.vue (이 구성 요소를 클릭하여 상세 페이지로 이동)
<template>
<div class="goods-info" @click="goGoodsPage()">
<div class="goods-image">
<img v-lazy="goodsImage">
</div>
<div class="goods-name">{{goodsName}}</div>
<div class="goods-price">¥{{ goodsPrice.toFixed(2) }}</div>
</div>
</template>
<script>
export default {
name: "goodsInfo",
//
props: ["goodsImage", "goodsName", "goodsPrice", "goodsId"],
data() {
return {};
},
methods: {
goGoodsPage() {
// Goods.vue ,name Goods.vue name
this.$router.push({name:"goods",query:{goodsId:this.goodsId}})
}
}
};
</script>
<style lang="scss" scoped>
.goods-info {
padding-bottom: 0.2rem;
.goods-image {
text-align: center;
img{
width: 95%;vertical-align: middle;
}
}
.goods-name {
padding: 0 8px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.goods-price {
text-align: center;
color: #e5017d;
}
}
</style>
2 상품 상세 정보 페이지 Goods.vue(상품 구성 요소 수신 페이지 GoodsInfo.vue에서 전송된 goodsId)
<template>
<div> </div>
</template>
<script>
import url from "@/urlApi.js";
export default {
name: "goods",
data() {
return {
goodsId: ""
};
},
created () {
// GoodsInfo.vue goodsId
this.goodsId = this.$route.query.goodsId
console.log(this.goodsId)
this.getGoodsInfo();
},
methods: {
getGoodsInfo() {
let that = this;
this.$http
.post(url.getDetailGoodsInfo,{goodsId: that.goodsId})
.then(response => {
// goodsId
console.log(response)
})
.catch(error => {
});
}
}
};
</script>
<style lang="scss" scoped>
</style
상기 vue가 Dashboard를 누르면 서로 다른 내용이 같은 표로 넘어가는 실례는 바로 편집자가 여러분에게 공유한 모든 내용입니다. 참고도 해주시고 저희도 많이 사랑해 주세요.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Fastapi websocket 및 vue 3(Composition API)1부: FastAPI virtualenv 만들기(선택 사항) FastAPI 및 필요한 모든 것을 다음과 같이 설치하십시오. 생성main.py 파일 및 실행 - 브라우저에서 이 링크 열기http://127.0.0.1:...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.