當我在 VSCode 中保存我的 Vue JS 組件時,下面顯示的模板代碼會從一行拆分為兩行或更多行,具體取決于“Load Depot..”字串的長度。
有時,根據字串的長度,它會在引號中間拆分并破壞我的代碼。
我在專案中同時啟用了 ESLint 或 Prettier,但我不知道哪個負責此問題以及如何修復它。
<h4>Depot Edit - {{ route.params.code }}, {{ depotStore.currentDepot ? depotStore.currentDepot.name : "Loading..." }} </h4>
這會在不方便的位置收到換行符
<h4>Depot Edit - {{ route.params.code }}, {{ depotStore.currentDepot ? depotStore.currentDepot.name : "Loading
Depot..."
}} </h4>
uj5u.com熱心網友回復:
Ctrl您可以通過 檢查您的 VSCode 格式化程式Shift,P搜索Format Document ...然后選擇您想要的格式化程式。
其次,您可以安裝Prettier ESLint - Visual Studio Marketplace。它使 Prettier 與 ESlint 一起作業。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/494273.html
