Vue Tabler Icons Guide

User
vue-tabler-icons
Assistant
`vue-tabler-icons` is a Vue component library that provides easy access to **Tabler Icons**, a set of free and open-source SVG icons.

### Installation:
To install `vue-tabler-icons`, use either **npm** or **yarn**:

npm install vue-tabler-icons
# or
yarn add vue-tabler-icons

### Usage in Vue 3:
Once installed, you can import and use icons as components:

<script setup>
import { IconHome, IconSettings } from "vue-tabler-icons";
</script>

<template>
  <div>
    <IconHome size="32" stroke-width="2" />
    <IconSettings size="32" stroke-width="2" />
  </div>
</template>

### Props:
– **`size`** (default: `24`) โ†’ Controls the icon size.
– **`stroke-width`** (default: `2`) โ†’ Adjusts the stroke thickness.
– **`color`** โ†’ Sets the icon color.

### Example with Custom Color:

<template>
  <IconUser size="40" stroke-width="1.5" color="blue" />
</template>

Let me know if you need further customization or setup help! ๐Ÿš€

User
vue3-perfect-scrollbar
Assistant
`vue3-perfect-scrollbar` is a Vue 3 wrapper for [Perfect Scrollbar](https://github.com/mdbootstrap/perfect-scrollbar), a lightweight custom scrollbar library.

## ๐Ÿ“Œ Installation

You can install it via **npm** or **yarn**:

npm install vue3-perfect-scrollbar
# or
yarn add vue3-perfect-scrollbar

You'll also need to install the original **perfect-scrollbar** package:

npm install perfect-scrollbar
# or
yarn add perfect-scrollbar

## ๐Ÿ”ง Usage

### 1๏ธโƒฃ **Global Registration**
Register `vue3-perfect-scrollbar` globally in your `main.js`:

import { createApp } from "vue";
import App from "./App.vue";
import PerfectScrollbar from "vue3-perfect-scrollbar";
import "vue3-perfect-scrollbar/dist/vue3-perfect-scrollbar.css"; // Import default styles

const app = createApp(App);
app.use(PerfectScrollbar);
app.mount("#app");

Now you can use the “ component anywhere in your Vue application.

### 2๏ธโƒฃ **Local Usage**
Instead of global registration, you can import it in a specific component:

<script setup>
import { PerfectScrollbar } from "vue3-perfect-scrollbar";
</script>

<template>
  <perfect-scrollbar style="max-height: 300px; overflow: auto;">
    <div style="height: 500px;">
      <p>Custom scrollbar content...</p>
    </div>
  </perfect-scrollbar>
</template>

## ๐ŸŽจ Customization
You can pass options to customize the scrollbar behavior:

<template>
  <perfect-scrollbar :settings="{ suppressScrollX: true }">
    <div>
      <p>Vertical scrolling only!</p>
    </div>
  </perfect-scrollbar>
</template>

#### ๐Ÿ”น Available Options:
– `suppressScrollX: true` โ†’ Disable horizontal scrolling.
– `suppressScrollY: true` โ†’ Disable vertical scrolling.
– `wheelSpeed: 2` โ†’ Adjusts scroll speed.

For more options, check the [Perfect Scrollbar documentation](https://github.com/mdbootstrap/perfect-scrollbar#options).

## โœ… Example with Dynamic Content:

<script setup>
import { ref } from "vue";
import { PerfectScrollbar } from "vue3-perfect-scrollbar";

const items = ref(Array.from({ length: 50 }, (_, i) => `Item ${i + 1}`));
</script>

<template>
  <perfect-scrollbar style="max-height: 200px; overflow: auto;">
    <ul>
      <li v-for="item in items" :key="item">{{ item }}</li>
    </ul>
  </perfect-scrollbar>
</template>

## ๐ŸŽฏ Why Use `vue3-perfect-scrollbar`?
โœ”๏ธ Smooth scrolling experience
โœ”๏ธ Easy integration with Vue 3
โœ”๏ธ Customizable scrollbar behavior
โœ”๏ธ Lightweight & performant

Let me know if you need further customization! ๐Ÿš€

User
โœ˜ [ERROR] Could not resolve "apexcharts"
Assistant
The error `Could not resolve "apexcharts"` usually occurs when `apexcharts` is missing or not properly installed. Since you're likely using `vue3-apexcharts`, follow these steps to fix it.

## โœ… **Step 1: Install ApexCharts**
Since `vue3-apexcharts` is a wrapper around `apexcharts`, you need to install both:

npm install apexcharts vue3-apexcharts
# or
yarn add apexcharts vue3-apexcharts

If you already installed it but still see the error, try reinstalling:

rm -rf node_modules package-lock.json yarn.lock
npm install
# or
yarn install

## โœ… **Step 2: Import Correctly**
Ensure you are correctly importing and using the component. Example:

<script setup>
import VueApexCharts from "vue3-apexcharts";
</script>

<template>
  <VueApexCharts
    type="line"
    :options="chartOptions"
    :series="series"
    height="300"
  />
</template>

<script>
export default {
  data() {
    return {
      chartOptions: {
        chart: { id: "vuechart-example" },
        xaxis: { categories: [1991, 1992, 1993, 1994] },
      },
      series: [{ name: "series-1", data: [30, 40, 45, 50] }],
    };
  },
};
</script>

## โœ… **Step 3: Add ApexCharts Globally (Optional)**
If you're using ApexCharts in multiple places, register it globally in `main.js`:

import { createApp } from "vue";
import App from "./App.vue";
import VueApexCharts from "vue3-apexcharts";

const app = createApp(App);
app.component("apexchart", VueApexCharts);
app.mount("#app");

Then, use it anywhere:

<apexchart :options="chartOptions" :series="series"></apexchart>

## โœ… **Step 4: Check for Import Issues**
If you are using **Vite**, ensure that your `vite.config.js` allows CommonJS modules:

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

export default defineConfig({
  plugins: [vue()],
  optimizeDeps: {
    include: ["apexcharts"],
  },
});

## โœ… **Step 5: Restart Dev Server**
Sometimes, a restart is required after installing dependencies:

npm run dev
# or
yarn dev

If you're still facing the issue, let me know your setup (Vite, Webpack, etc.) so I can assist further! ๐Ÿš€

Leave a Comment

Your email address will not be published. Required fields are marked *