效果图
1.思路:根据menuId请求数据来渲染页面,推荐使用组件Element.Ui,通过获取路由参数来判断登录用户
data() {
return {
menuInfo: {
userInfo: {},
raw_material: {
main_material: [],
accessories_Materiak: [],
},
steps: [],
},
};
},
watch: {
$route: {
handler() {
let { menuId } = this.$route.query;//获取路由参数
if (menuId) {//判断用户
//异步获取数据
menuInfo({ menuId }).then(({ data }) => {
console.log(data);
this.menuInfo = data.info;
});