需求是首先通過一個異步的方式獲取一個組件名稱的列表,然后根據這個列表(字符串數組形式)加載這個列表上的組件,然后循環顯示在頁面上我先照著vue官網上的搞了一個,我現在可以將組件異步加載,但是我不知道該如何進行下去了constAsyncComponent=()=>({component:import(`../plugs/Link`)})exportdefault{name:'Menu',components:{},data(){return{plugs:[]}},created(){},computed:{Link:function(){returnAsyncComponent}}}接vv13的回答:上邊的例子是我現在寫的樣子,容易誤導人,我換一種需求的例子目前需求里示例中的Link1、Link2等組件不一定存在,全是從另一個接口中獲取的組件列表例如:exportdefault{name:'Menu',components:{//此處并非固定,所有組件均從后臺添加前臺無法在components中寫死},data(){plugs:[]//此為組件列表},created(){//此處獲取到列表fetch('plugs.php').then((data)=>data.json()).then((data)=>{//data可能是['Link1','Link2','components1','components2',...]所有組件均從后臺添加前臺無法在components中寫死,并且在此假設所有組件文件都由后臺上傳并存放在`../plugs/Link`目錄下this.plugs=data;})},computed:{}}