vue-mixins is a collection of reusable mixins designed for Vue.js applications, primarily targeting Vue 1.x and Vue 2.x versions. The package, currently at version 0.3.6 and last updated around 2020, includes utilities for DOM interaction (like `getViewportSize`, `onWindowResize`), event handling (`onClick`, `onDocument`), and state management (`isOpened`). Its policy states that mixins are never removed for deprecation; instead, if an API changes, the mixin's name is updated (e.g., `onResize` became `onResize2`). This reflects an older approach to code reuse in Vue, preceding the Composition API introduced in Vue 3. The package is effectively abandoned, lacking ongoing maintenance or compatibility updates for newer Vue versions.
npm install vue-mixinsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate `onClick` and `getViewportSize` mixins into a Vue 2.x component using CommonJS `require` statements. It shows how the mixin's methods become available on the component instance.
For Vue 3, refactor reusable logic into Composition API composables. If targeting Vue 2, ensure you are using Vue 2.x.
Always consult the mixin list and documentation to select the correct version-specific mixin for your target Vue.js major version (e.g., `require('vue-mixins/isOpened2')` for Vue 2.x).Avoid using deprecated mixins. Look for a newer, renamed alternative (e.g., `onResize2` if available) or implement similar functionality using Vue's built-in capabilities or the Composition API (for Vue 3).
For ESM projects, configure your build tool to handle CommonJS modules. Otherwise, stick to `require()` in Node.js environments or include the `bundle.js` for browser global access.
Consider migrating to actively maintained alternatives, especially Vue 3's Composition API for new development. For existing Vue 2 projects, be aware of the lack of support and potential vulnerabilities.
Ensure your project or file uses CommonJS (`.js` files with `"type": "commonjs"` in `package.json` or older Node.js versions) or configure your build tool (e.g., Webpack) to resolve CJS modules in an ESM environment. Alternatively, include `bundle.js` in a browser for global access (`window.vueMixins`).
Double-check the exact path for the mixin (e.g., `vue-mixins/onClick`). Ensure the package is correctly installed and accessible at the specified path. This error can also occur if attempting to use with Vue 3, where mixins behavior is different and often discouraged in favor of Composition API.
Verify that the mixin is correctly listed in the component's `mixins` array and that the method you are calling is indeed provided by that mixin. Ensure you're using the correct mixin variant (e.g., `isOpened2` for Vue 2.x).
No dependency data recorded yet.