<template>
<AboutConfirm :projects="projects"/>
</template>
<script>
import AboutConfirm from '../../components/HomePage/AboutConfirm.vue'
export default{
data(){
return {
projects:[],
projectsStr:''
}
},
components: {
AboutConfirm
},
created: function () {
this.projects = this.$route.query
this.projectsStr = JSON.stringify(this.$route.query)
},
beforeMount(){
console.log('beforeMount');
console.log('this.projects--------------');
console.log(this.projects);
// console.log(JSON.this.projectsStr);
let url = SERVER.api.getMyProject
PM.fnRequestAjax(url, null, 'get', (data) => {
// this.projects = data.data.not_process
// console.log('data.data.not_process');
// console.log(data.data.not_process);
})
},
mounted(){
},
updated(){
console.log('updated');
},
activated(){
console.log('activated');
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
當跳到其他頁面,再呼叫window.history.go(-1),在beforeMount中的讀到的資料變成"[object Object]"
[object object] 是 物件 toString() 方法的預設回傳值
你應該用 JSON.stringify(obj) ;
沒有人知道projects經歷了什麼