
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@vuemod/prefetch
Advanced tools
Easily fetch data before rendering a vue component with vue-router and vuex
If you've used vue-router, vue and vuex or pinia, you are familiar with this problem.
The beforeRouteEnter guard does NOT have access to this, because the guard is called before the navigation is confirmed ...
Of course you can use:
beforeRouteEnter (to, from, next) {
next(vm => {
// access to component instance via `vm`
})
}
But, if you use vuex and make a mutation, then the component will be rendered first, and then the data will appear. (The code in the next construct is executed after all hooks).
Of course, you can get data centrally in the beforeResolve hook, but then if your application grows, you will have to write a separate router ...
Plugin adds additional prefectch hook (Similar to serverPrefetch) to components, mixins, extended components and global mixins.
yarn add @vuemod/prefetch
or
npm i @vuemod/prefetch
import {createPrefetch} from "@vuemod/prefetch";
// ....
const prefetch = createPrefetch();
app.use(prefetch, router, store);
export default defineComponent({
prefetch: definePrefetch(async({
app, // Instance of the app
store, // Instance of the store|pinia
router, // Instance of the router
isClient, // Execute on client
isInitial, // Execute in initial navigation (server or client)
isFetch // Execute in fetch mode (client and first navigation or server)
}, to, from, next?) => {
// your code
})
});
FAQs
Easily fetch data before rendering a vue component
We found that @vuemod/prefetch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.