![](/img/trans.png)
[英]How to call useRouter inside useFetch's onFetchError by VueUse?
我需要使用 createFetch() 從 VueUse 創建可組合的自定義提取,我想檢查請求是否返回 401 狀態,我希望將路由重定向到登錄路由。export const useApiFetch = createFetch({ baseUrl: import.meta.env.VITE_AP ...
[英]How to call useRouter inside useFetch's onFetchError by VueUse?
我需要使用 createFetch() 從 VueUse 創建可組合的自定義提取,我想檢查請求是否返回 401 狀態,我希望將路由重定向到登錄路由。export const useApiFetch = createFetch({ baseUrl: import.meta.env.VITE_AP ...
[英]watching vueuse's useElementVisibility changes is not working
我在https://github.com/eric-g-97477-vue/vue-project有一個示例項目這是安裝了vueuse的默認 vue 項目。 我將HelloWorld.vue的腳本和模板部分修改為: 並調整了 App.vue以便 HelloWorld 組件可以輕松地在屏幕上或屏幕外滾 ...
[英]Post request with useAxios
我正在嘗試在我的 Vue 應用程序上使用組合 api,我需要向我的后端 api 發出發布請求。我正在嘗試使用 vueuse 中的“useAxios”實用程序,但我不知道如何將數據傳遞到 post 請求中。 它在文檔中沒有正確顯示...... 我想將以下 axios 請求轉換為使用“useAxios” ...
[英]VueUse: How to use the isSupported variable multiple times?
我想為共享按鈕做一個后備。 如果 useShareDialog isSupported = 打開 ShareDialog 如果 useShareDialog !isSupported = 復制到剪貼板如果 useClipboard !isSupported = 不顯示分享按鈕 VueUse有use ...
[英]How to use onClickOutside (vueuse) on two dom elements?
onClickOutside package 中的vueuse function 可用於在ref外部發生點擊事件時觸發: dom元素: 但是有沒有辦法在兩個 dom 元素上使用它? 我想要的是在用戶單擊兩個元素之外時觸發 function。 我嘗試在兩個 dom 元素上添加相同的ref ,但 ...
[英]How to use VueUse useFirestore() with a Where QueryConstraint?
我有一個看起來像這樣的 Firestore users文檔:{ currentCompanyId: "123", displayName: "Mary Jane" } 還有一個看起來像這樣的 Firestore websites文檔:{ companyId: "123" ...
[英]How to reference a VueUse useFirestore ref in another useFirestore?
我正在嘗試使用 VueUse useFirestore()包裝器。 它返回一個與 Firestore 文檔同步的 ref。 目前我可以使用它來獲取和顯示users文檔。 但是現在我需要通過引用users文檔中的currentWebsiteId字段來獲取和顯示websites文檔。 當我嘗試這樣做時 ...
[英]Typescript dectect error on vueuse source code
我在 vue 上完成了我的項目,並希望為生產而構建。 當我進入yarn build , Typescript 檢測到@vueuse/core源中的錯誤 package.json{ ... "dependencies": { ... "@vue/composition-api": "^1 ...
[英]How to re-use the firestore's db accross the different page in View?
我第一次使用 VueUse 創建一個 Vue 應用程序。 在我的 main.ts 中,我有這個: 所以在我看來,當我想使用我的 Todos 時,它可以很好地與 useTodos 掛鈎,但是有很多時候我需要訪問一個非常具體的文檔(例如/collection/key-one/sub-collectio ...
[英]How to stop useAsyncState from running immediately?
我正在嘗試使用VueUse library中的useAsyncState() 。 我正在使用{ immediate: false }選項標志,因為我不希望它立即運行。 但是代碼總是立即運行,我不知道為什么。 這是我的代碼:import { useAsyncState } from '@vueuse ...
[英]How to correctly type the VueUse useFirestore() wrapper?
我正在使用 VueUse.org 提供的這個useFirestore()包裝器我正在嘗試輸入它返回的user引用User ,如下所示:import { User } from 'src/types'; const userId = useUserStore().user.id; const use ...
[英]VueUse useDark() does not trigger computed or watch
但是,像下面這樣的自定義組合會觸發手表和計算的更新。 另外,這個 vueuse 庫返回 WritableComputedRef 類型,我不知道這是否是這里的問題。 ...
[英]Vue useStorage (usevue) always starting clean rather than importing state in Pinia store
我在vitesse-nuxt3之上構建了我的應用程序,除了嘗試通過vueuse使用 LocalStorage 之外,一切都很順利。 零件: 松樹專賣店: 我看着它設置數據(在 Chrome 的開發工具中),但它總是重新加載默認數據,而不是在刷新之間持續存在。 謝謝你。 ...
[英]Nuxt3 + Pinia + VueUse -> useStorage() not working
設置:我正在使用 Nuxt3 + Pinia + VueUse。 目標:我想通過 VueUse: useStorage將 pinia 商店的 state 保存到本地存儲。 問題:出於某種原因,沒有在本地存儲中創建項目。 我覺得我在這里錯過了什么。 在組件中,我可以很好地使用useStorage 。 ...
[英]VueUse session storage
使用VueUse時如何指定存儲應該是本地還是session? 它似乎沒有在文檔中提及它https://vueuse.org/core/usestorage/ ...