vue3-tabor
π A powerful Vue 3 tab routing solution that supports tab navigation with keepAlive capability
Compatible with multiple component libraries and providing rich customization options
## β¨ Features
- **π₯ Easy to Use**: Zero learning curve, just import and use
- **π¨ Highly Customizable**: Rich APIs and configurations to meet requirements from basic to complex
- **π¦ Lightweight & Efficient**: Optimized for Vue 3 and Vue Router 4, delivering excellent performance with a small footprint
- **πͺ TypeScript Support**: Developed with TypeScript, providing complete type definitions for superior development experience
## π οΈ Core Functionality
- ### Basic Features
- β
**Route Response**: Automatically responds to route changes, opening and switching tabs
- β
**Tab Management**:
- β
Open/Replace tabs
- β
Close tabs
- β
Close other tabs
- β
Refresh tabs
- β
Right-click menu operations
- β
**Cache Control**: Supports tab content caching for improved user experience
- β³ **Global Configuration**: Supports global and custom configurations (in development)
- β³ **Lifecycle Hooks**: Provides rich lifecycle events (in development)
- ### Advanced Features
- β
**iframe Support**: Built-in iframe routing support for easy integration of external pages
- β³ **Animation Effects**: Tab switching animations (in development)
- β³ **Internationalization**: Multi-language support (in development)
- β³ **Analytics**: Tab access statistics (in development)
## π¦ Installation
```bash
npm install vue3-tabor
```
## π Quick Start
### 1. Import and register the plugin in your entry file
```js
import { createApp } from "vue";
import Tabor from "vue3-tabor";
// Import CSS file (required)
import "vue3-tabor/dist/assets/index.css";
import router from "./router";
import App from "./App.vue";
const app = createApp(App);
app.use(router);
app.use(Tabor, {
router, // Pass the router instance
maxCache: 10 // Optional: maximum cache size
});
app.mount("#app");
```
### 2. Use the tab component in your layout
```html