在最外層寫一個div,把所有的前端代碼放進去就好了參考成功解決Component template should contain exactly one root element_前方一片光明-CSDN博客