实现的代码如下: mounted() { let menus = menu.list(); this.menus = menus; }, created() { this.getRandCode()