post传参的时候categorys 为啥不能识别呢?
代码贴在下面:
<script>
export default {
name: "app",
components: {},
data() {
return {
banner: require("@/assets/hottopic/banner.png"),
data: [],
filter: {
page: {
pageSize: 5,
pageNumber: 1,
totalSize: 100
},
categorys: ["小微企业专题"]
}
};
},
computed: {},
methods: {
getData() {
this.filter.categorys = ["this.$route.params.id"]
this.$API.post("/articlelist/query", this.filter).then(res => {
console.log(res);
this.data = res.list;
});
}
},
created() {
if(this.$route.params.id){
this.getData();
}
},
mounted() {},
watch:{
"$route":"getData"
}
};
</script>