uiv is a lightweight collection of Bootstrap 3 components meticulously re-implemented for Vue.js. The current stable version, 2.0.6, targets Vue 3, while previous 1.x versions supported Vue 2. The library is actively maintained with frequent bug fix releases, as seen in the recent 2.0.x updates. Key differentiators include its small bundle size (approximately 20KB gzipped for all components), absence of an additional CSS file (relying on Bootstrap's own styles), support for individual component imports to minimize payload, and compatibility with Server-Side Rendering (SSR). It provides a comprehensive set of common UI elements like Modals, Tabs, Dropdowns, and more, enabling developers to build Bootstrap-styled interfaces using Vue's reactivity system. This library aims to provide a native Vue experience for Bootstrap 3, distinguishing itself from wrappers that might rely on jQuery or other external dependencies for component logic.
npm install uivVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize uiv as a Vue 3 plugin and use a basic modal component, highlighting the necessity of importing Bootstrap's CSS.
For Vue 3 projects, install `uiv@^2`. For Vue 2 projects, install `uiv@^1`. Review the migration guide if upgrading an existing Vue 2 project to Vue 3 and uiv v2.
Ensure `import 'bootstrap/dist/css/bootstrap.min.css'` is present in your main application entry file (e.g., `main.js` or `App.vue` script setup).
If using the `Btn` component with routing functionality, ensure `vue-router` is installed and registered with your Vue application (e.g., `app.use(router)`). If you only need a simple button, consider using a standard HTML `<button>` or another uiv component without routing properties.
Always call `app.use(uiv)` if you intend to use any of the provided directives. If you need to use directives without global registration, you may need to import and register them locally (refer to uiv documentation for specific directive imports).
Ensure you have `app.use(uiv)` in your main application entry point (e.g., `main.js`) if you are using global registration. Alternatively, if importing individual components, make sure they are properly imported and registered locally or globally.
Confirm you are creating your Vue application with `createApp()` (Vue 3) and that `app` refers to the return value of this function, e.g., `const app = createApp(App)`.
This error is generally NOT related to `uiv`. If you encounter it, check if you have other Bootstrap-related JavaScript libraries or custom scripts that mistakenly expect jQuery and Bootstrap's JS. uiv components are implemented natively in Vue.