0.1.49 • Published 5 months ago

@virsas/vue-components v0.1.49

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@virsas/vue-components

Virsas Vue3 / Quasar2 component and utility library

Installation

Install

cd vue3_project
npm install @virsas/vue-components
npm run dev

Use plugin (edit main.js file)

import { createApp } from "vue";

import App from "./App.vue";
import virsas from "@virsas/vue-components";

import "./main.css";

const app = createApp(App);

app.use(virsas);
app.mount("#app");

Usage (edit any .vue file)

<script setup>
const assetsURL = import.meta.env.VITE_ASSETS_URL;
</script>

<template>
  <q-layout view="hHh LpR fff">
    <q-page-container>
      <q-page>
        <div class="row justify-center q-py-xl">
          <div class="col-xs-10 col-sm-6 col-md-3 col-3">
            <VLogo
              :darkable="true"
              :assets-url="assetsURL + '/logo'"
              logo-name="main"
            />
          </div>
        </div>
        <div class="row justify-center">
          <div class="col-xs-10 col-sm-8 col-md-4 col-4">
            <div class="text-center">
              <router-view />
            </div>
          </div>
        </div>
      </q-page>
    </q-page-container>
  </q-layout>
</template>

Usage of utilities

import { defineStore } from "pinia";
import axios from "axios";

import { apiHeaders, notify } from "@virsas/vue-components";

const api = import.meta.env.VITE_API_URL;

export const useStore = defineStore("item", {
  state: () => ({
    items: [],
  }),
  actions: {
    async list() {
      try {
        const res = await axios.get(`${api}/items`, apiHeaders());
        this.items = res.data;
        return true;
      } catch (e) {
        notify({ message: `error.${e.response.data.error}` });
        return false;
      }
    },
  },
});

Utilities List

Content

  • setMetadata

Date

  • stringToDate
  • stringToDatetime
  • stringToTime
  • stringToTimestamp
  • currentYear

Header

  • apiHeaders

Notification

  • notify

Pagination

  • pagedArray

Time

  • sleep

Validation

  • isValidEmail
  • isValidTelephone
  • isValidLength
  • isValidConfirmation
  • isGoodPassword

Components List

Elements

  • VElementBreadcrumb
  • VElementButton
  • VElementIteem
  • VElementLogo
  • VElementTable

Form

  • VForm
  • VFormDate
  • VFormInput
  • VFormSelect
  • VFormCheckbox

Page

  • VPageHeader
  • VPageLegal
  • VPageLoading
  • VPagePopup

Individual components

VElementLogo

Description

This component can be used to show a clickable or non clickable logo with configurable assets url, website to point to and image source for dark and light theme.

Props

Prop NameRequiredDefault ValueExample value
assetsURLhttps://assets.example.org
logoNamelogo
logoExtencionpngjpg
websiteURLhttps://www.example.com
websiteLocaleen-US
darkablefalsetrue
width100%50px
classq-mt-xl
0.1.49

5 months ago

0.1.48

5 months ago

0.1.30

8 months ago

0.1.31

8 months ago

0.1.32

8 months ago

0.1.10

10 months ago

0.1.33

8 months ago

0.1.11

10 months ago

0.1.34

8 months ago

0.1.12

10 months ago

0.1.35

8 months ago

0.1.13

10 months ago

0.1.36

8 months ago

0.1.14

10 months ago

0.1.37

8 months ago

0.1.15

10 months ago

0.1.27

8 months ago

0.1.28

8 months ago

0.1.29

8 months ago

0.1.41

7 months ago

0.1.42

6 months ago

0.1.20

9 months ago

0.1.43

6 months ago

0.1.21

9 months ago

0.1.44

6 months ago

0.1.22

9 months ago

0.1.45

6 months ago

0.1.23

9 months ago

0.1.46

6 months ago

0.1.24

8 months ago

0.1.47

6 months ago

0.1.25

8 months ago

0.1.26

8 months ago

0.1.40

8 months ago

0.1.38

8 months ago

0.1.16

10 months ago

0.1.8

10 months ago

0.1.39

8 months ago

0.1.17

10 months ago

0.1.7

10 months ago

0.1.18

10 months ago

0.1.19

9 months ago

0.1.9

10 months ago

0.1.4

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.3

11 months ago