我想嘗試使用 Vue3 vue-i18n 9.3 進行插值。當我嘗試傳遞論點時,我得到了;
Message compilation error: Not allowed nest placeholder
1 | Showing {{from}} to {{to}} of {{total}} entries
我的語言環境 json 檔案;
...
"showing_0_to_0_of_0_entries": "Showing {{from}} to {{to}} of {{total}} entries",
...
在我的組件內部;
<div class="info">{{ $t('showing_0_to_0_of_0_entries',{ from: 0, to: 15, total:8 }) }}</div>
但它不起作用,我收到錯誤并且在我的頁面中顯示這樣的文本;
Showing {{from}} to {{to}} of {{total}} entries
不是驗證通過。我可以做什么?
uj5u.com熱心網友回復:
根據檔案,我應該使用一個大括號,例如{}. 所以這是我的解決方案;
"showing_0_to_0_of_0_entries": "Showing {from} to {to} of {total} entries",
檔案
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/507935.html
