![](/img/trans.png)
[英]How to dynamically append template in Vue 3
我正在嘗試設置一個動態向表中添加行的 Vue 3 組件。 到目前為止,我有以下內容: <template> <table> <tbody> <tr v-for="(item, index) in tableRo ...
[英]How to dynamically append template in Vue 3
我正在嘗試設置一個動態向表中添加行的 Vue 3 組件。 到目前為止,我有以下內容: <template> <table> <tbody> <tr v-for="(item, index) in tableRo ...
[英]how to manage v-on/@ in dynamic components <component :is="currentPage" etc. ></component> structure in vue3 options api
我正在學習 Vue 3 Options API 中的動態組件渲染,到目前為止,我已經了解:is="currentPage" 以及 v-bind="currentProps" 的工作原理。 但是在以下情況下,我無法弄清楚如何處理我的事件偵聽器: 假設我有 3 個組件:A、B、C。 每個組件都有一個或 ...
[英]Calling methods inside beforeRouteEnter NProgress
在導航到路線之前,我正在嘗試調用 API。 問題是,如果我嘗試在 beforeRouteEnter 內部調用 axios 調用,例如它工作正常; 但是,當我嘗試從方法調用 API 時,它會在解析 API 之前導航到路線,並且 NProgress 欄也在解析調用之前完成。 誰能指導我可能出了什么問題? ...
[英]VueJS 3 See all globally registered components. this.$options.components is empty
您好,我有一個使用 Vite 的新 Vue 3 應用程序。 我正在全局注冊我的UserTextInput組件,但在我的所有組件中this.$options.components是空的 在任何其他組件內 我正在尋找一種方法來查看哪些組件已在全球范圍內注冊。 有任何想法嗎? ...
[英]Migrating from vue2 with property-decorator and class style syntax to vue3
我維護着一個相當大的 vue2 項目,它在其他庫中使用了 Vuetify、vue-class-component、vue-property-decorator 和 typescript。示例組件: (為了顯示語法,該組件已簡化且不可編譯) 我們對這個設置非常滿意,因為語法簡單,新老開發人員都很 ...
[英]VueJS - Cannot import a computed property from another computed property
我使用計算屬性來獲取路由 URL 中的 id 參數,如下所示: 但是當我想訪問releves this.extractionId ,我有一個錯誤,我有這個錯誤顯示: 我不能依賴另一個計算屬性嗎? ...
[英]How to access method from the child component in parent in Vue.js
我想訪問父組件中的方法,而該方法存在於子組件中。 我嘗試使用混合。 但是 function 返回的是 null 而不是值。 如果我嘗試發出 object 並且在父組件中工作正常。 如何在 vue3 選項 API 中訪問父其他方法中的子方法父視圖 兒童.vue ...
[英]vue 3 before create event in main.js
我正在嘗試在main.js beforeCreate 這段代碼在 Vue 3 中的等價物是什么?new Vue({ el: '#app', router, components: { App }, store: store, beforeCreate() { this.$sto ...
[英](Vue.js 3 Options API) How do I access a child method?
我需要使用 Vue.js 3 和選項 API 來訪問子組件的方法。在How to access to a child method from the parent in vue.js 中有一個答案,但它適用於 Vue.js 2 和 Vue.js 3 但具有 Composition 88103085 ...
[英]Show loaded data in curly braces using Vue 3 Composition API
有人可以解釋以下之間的區別嗎? 選項 API 版本按預期在 DOM 中顯示加載的數據export default { data() { return { config: {}, }; }, async mounted() ...
[英]Cannot read properties of undefined (reading 'toLowerCase')
我正在使用 Vue 創建一個搜索輸入,並且我做了一個方法來檢查每個項目是否應該可見,並將當前用戶輸入與項目的數據進行比較,並返回 true 或 false。 我在控制台上遇到的問題,它向我顯示了與“toLowerCase”相關的錯誤。 請一些幫助和建議。 提前致謝。 ...
[英]I keep getting "maximum recursive updates exceeded" in Vue when using axios and v-for
我正在建立一個電子商務網站,並為產品卡創建了一個組件。 我將該組件導入主頁,以便顯示產品列表。 我在 data(){} 中聲明了一個產品變量,還創建了一個 beforeMount 並將我的邏輯放入其中以使用 axios 獲取數據。 每次我加載頁面時,我都會收到錯誤消息: 未捕獲(承諾)錯誤:超出最 ...
[英]What is the Vue Options API?
我知道 Vue 3 的主要特性之一是 Composition API,它是舊 Vue Options API 的替代品。 但我似乎找不到 Options API 的簡單文本定義 - 它是什么? ...
[英]Do I have to use the Composition API in Vue 3, or can I still do things the "Vue 2" way?
是否可以安裝 Vue 3,但仍以“Vue 2”方式進行操作? 換句話說,我看到 Vue 3 有新的組合 API,但在 Vue 3 中這是可選的還是必需的做事方式? 出於某種原因,我認為 Vue 3 仍然允許您以 Vue-2 的方式做事,而是使用選項 API。 不是這樣嗎? 謝謝。 ...