![](/img/trans.png)
[英]how to add Vue props value to background-image
我是 VueJS 的新手,我對從 Vue 道具值更改背景圖片感到困惑。 我從“vue3-easy-data.table”創建了簡單的表格。 基表.vue:<template> <EasyDataTable> ... </EasyDataTable> < ...
[英]how to add Vue props value to background-image
我是 VueJS 的新手,我對從 Vue 道具值更改背景圖片感到困惑。 我從“vue3-easy-data.table”創建了簡單的表格。 基表.vue:<template> <EasyDataTable> ... </EasyDataTable> < ...
[英]How to create a dynamic background image for components in Vue using props?
客觀的我想將圖像的路徑作為道具傳遞給組件。 我希望組件使用 prop 動態生成背景圖像。 我所有的圖像都在 Vue src 文件夾中的資產文件夾中。 路徑看起來像“@/assets/images/subject/computers.jpeg” 問題沒有出現背景圖像這是頁面上呈現的內容: 但是,沒 ...
[英]How to pass refs from parent component to child component? Without using Typescript?
我有一個 App.vue,其屬性為“clicked”,我正試圖將其傳遞給子組件。 App.vue 因此可以有條件地呈現子組件,例如: 側邊抽屜.vue 我是否在“App.vue”中正確傳遞了“clicked”引用? 如果我這樣做了,你如何在子組件中訪問它們? 我已經用谷歌搜索並查看了一堆 Sta ...
[英]Vue3 init variable with props
例如 a={x: 'y'} 每次調用 function 計算時,我都需要在 b.push 之前將 b 設為 {x: 'y'},但 b 一直在推送 xxx:yyy,有什么解決方案嗎? 我試過 ref(props.a), reactive(props.a), 還是不行第一次調用計算,output 是 ...
[英]Prop being passed but not updating the component
所以我有一個名為 updateAll(data.items) 的 function,它應該采用數組並隨機分配一個新名稱,當我在 vue 開發工具中查看時,data.items 似乎正在更新並被傳遞給組件但實際上並沒有更新瀏覽器我還在我的 buildData.js 中添加了它用於同一個應用程序,但在反 ...
[英]vue 3 props are not passed to the child element
我是新手,所以請有人幫助我,我試圖將 obj 作為道具傳遞給子元素,但我得到的是 arr[0] val 而不是 {id: 1, name: 'General'} 在那里我綁定道具值,currentRoom 是一個 const 與 Object。 currentRoom 的值在那里是正確的,等於 { ...
[英][Vue warn]: Invalid prop: type check failed for prop "....". Expected String, returned function()
我今天一直收到這個錯誤。 我是第一次使用 VUEX,我正在嘗試使用 Getter 來查找數組中的元素。 我假設問題一定出在我在第一個代碼片段中傳遞的第二個參數 ( title ) 中,或者出在我調用getErrorByMbId function 的方式中。 我在注冊 Getter 的商店中所做的事 ...
[英]How to pass rest of the properties which are not defined as props to a component in Vue?
例如,我正在編寫一個組件CustomButton ,但我不想聲明所有可能的道具,例如 class、標題等,也不想傳遞所有事件。 在React中,我們可以獲得道具的 rest 並像下面這樣使用它們 - 這在 Vue 中怎么可能? ...
[英]How can I modify props values once the page has been refreshed in Vue?
他遵循我的代碼: 我做了這個例子。 問題是我想訪問 onMounted() 中的道具值,但如果我使用 console.log(account.value.date) 它說未定義。 那么有沒有辦法在模板中顯示之前修改道具值? 謝謝! 我只想在頁面顯示之前修改從 pops 獲得的值。 ...
[英]How to make text interpolation work inside css functions and router links
我試圖實現一個可重用的卡片組件,所以我將它們打印在逐個圖像更改的變量屬性中這是我的代碼。 至於標題,它完美地工作。 我實施了很多次,所以我的問題是不同的。 我還在胡須內添加了這個道具的文字,所以我可以從我的卡片中更改鏈接和圖像,但它不起作用,所以我需要你的幫助。 我可能只是不明白文本插值是如何工作的 ...
[英]Pass property into root component of Vue 3 app from main.ts
我嘗試將 boolean 屬性從 main.ts 內部傳遞給 App.vue 主.ts:const freshchatActive = false; new Vue({ router, store, i18n, vuetify, props: { freshchatActive ...
[英]Why I can't see my props from backend in my nuxt page?
我正在制作一個索引頁面,我必須從我的數據庫客戶數據中恢復並將其插入到我的索引頁面的表元素中。 我已經設置了我的道具,使用 axios 的安裝函數從后端路由獲取數據,並在數據函數中返回客戶數組, 我的 index.vue 頁面:<template> <div> ...
[英]Vue 3 - Render component from string
我有個問題。 我有一個名為 ValidateCheckboxes 的組件。 ValidateCheckboxes 是經過驗證的復選框列表。 我通過道具將復選框傳遞給這個組件。 看起來像這樣:在這里輸入圖像描述在這里輸入圖像描述我正在使用 v-for 顯示復選框:在這里輸入圖像描述但是我的標簽看起來 ...
[英]Property or method "$store" is not defined on the instance but referenced during render in Vuex
我正在學習 VueJs 的 state 管理我堅持這一點,如果有人知道請告訴我如何在我的 Vue 組件中呈現 $store 當我控制 $store 未定義時主程序 ` `索引.js HomeView.vue ` ` 此代碼在控制台上顯示錯誤。 ...
[英]How to make a sample that shows the 'Props are overwritten when re-rendering' anti pattern
我想確信“重新渲染時 Props 被覆蓋”是一種反模式。 更新代碼筆: https://codepen.io/SVSMITH/pen/LYrXRzW 誰能幫忙? ...
[英]Problem while passing data to child component using props in Vue
我是 Vue Js 的新手,遇到了一個問題。 我正在使用 Axios 來獲取帶有JSON 占位符 API的用戶數據。 在Sidebar component中。 我使用 getter 從 Vuex 商店獲取用戶數據。 在Sidebar component中,我有一個名為User的子組件,它將為每個傳入 ...
[英]can't access props string in image source in Vue (with Laravel 9)
我正在嘗試在 Vue 中顯示一個圖像,其中源是從道具(來自 Laravel)中提取的。 道具在那里,但我無法在瀏覽器中呈現它。 事實上,如果我嘗試單獨顯示任何值,它會顯示為空白,我認為這是問題所在。 儀表盤.vue 如果我刪除“.image”並只使用“$page.props.games”,我會得到 ...
[英]v-for adding two props in the same component vuejs
伙計們我想做一個 v-for 使用一個有兩個不同道具的組件零件 V-FOR 內部其他組件 有什么辦法也可以使用 v-for 添加 cardNumber 嗎? 它按原樣工作得很好,但我想同時使用這兩個道具,而不僅僅是 ItemCard ...
[英]Props in vue 3 typescript
我有一個這樣的組件,在 propы HEADER 我傳遞了字符串。 在子組件中,我接受道具並指定類型。 但是 typescript 對子組件中的 header 發誓。 ...
[英]Vue3 : Why my property is not defined on instance?
我正在構建一個虛擬應用程序,該應用程序在傳遞屬性的組件中包含一個組件。 我使用firebase來存儲數據,並嘗試讀取onMounted上的數據。 我收到此錯誤,但我不知道如何解決。 我缺少什么? App.vue 導入幾個組件。 我聲明了一個帶有接口的常量名稱。 OnMounted 數據被讀取並 ...