Quick Start
Introduction
vunio is a component library and toolset project based on Vue3 and elementPlus, consisting of the following parts:
- UI Component Library: Provides commonly used UI components, including dynamic components
- Utility Functions: Offers common utility functions
- Hooks: Provides reusable composable functions
- Directives: Offers commonly used directives
Installation
Install using a package manager:
bash
npm install @vunio/ui @vunio/utils @vunio/hooks @vunio/directivesbash
yarn add @vunio/ui @vunio/utils @vunio/hooks @vunio/directivesbash
pnpm add @vunio/ui @vunio/utils @vunio/hooks @vunio/directivesbash
bun add @vunio/ui @vunio/utils @vunio/hooks @vunio/directivesUsage
UI Components
ts
// Global import
import { createApp } from 'vue';
import UI from '@vunio/ui';
import '@vunio/ui/style.css';
const app = createApp(App);
app.use(UI);
// Import on demand
import { Button } from '@vunio/ui';
import '@vunio/ui/style.css';
const app = createApp(App);
app.use(Button);
// Components({
// resolvers: [vunioUIResolver()],
// })
/// <reference types="@vunio/ui/dist/types/index.d.ts" />Utility Functions
ts
import { isString } from '@vunio/utils';
console.log(isString('hello')); // trueHooks
ts
import { useCounter } from '@vunio/hooks';
const { count, increment, decrement } = useCounter();Directives
ts
import { vFocus } from '@vunio/directives';
// Global import
app.directive('focus', vFocus);
// Import on demand
import { vFocus } from '@vunio/directives';
app.directive('focus', vFocus);