vue从路径中获取参数
created() {
if (this.$route.params && this.$route.params.id) {
// vue从路径中获取参数 此处参数名为id
const id = this.$route.params.id
this.fetchDataById(id)
}
}
如有不当,欢迎指正
created() {
if (this.$route.params && this.$route.params.id) {
// vue从路径中获取参数 此处参数名为id
const id = this.$route.params.id
this.fetchDataById(id)
}
}