1.0.1 • Published 5 months ago

@todovue/tvlabel v1.0.1

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

TODOvue Label

TvLabel is a custom label component for web applications.

npm Netlify Status npm npm GitHub GitHub Release Date

Table of Contents

Installation

Install with npm or yarn

npm install @todovue/tvlabel
yarn add @todovue/tvlabel

Import

import { TvLabel } from '@todovue/tvlabel'

You can also import it directly in the main.js file, so you don't have to import it in the pages

import { createApp } from "vue";
import App from "./App.vue";
import TvLabel from "@todovue/tvlabel";

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

Usage

<template>
  <tv-label @click-label="clickHandler" color="#4FC08D">
    Vue
  </tv-label>
</template>

<script setup>
  import TvLabel from "@todovue/tvlabel"; // Only if you have not imported it from main
  
   const clickHandler = () => {
    console.log("clicked");
  }
</script>

Props

NameTypeDefaultDescription
colorString''label color in hexadecimal
textLabelString''If you don't want to send the name by slot you can send it by property
isEditBooleanfalseIf you want to show the edit icon
isRemoveBooleanfalseIf you want to show the remove icon
iconPositionStringrightIf you want to show the icons on the left or right side of the label
textColorString'inherit'Text color

Events

NameDescription
click-labelEvent that is triggered when the label is clicked
clickEvent that is triggered when the label is clicked

Development

Clone the repository and install the dependencies

git clone https://github.com/TODOvue/todovue-label.git
cd todovue-label

Install the dependencies

yarn install

Run the project

yarn demo

Run the tests

yarn test:unit

Run the linter

yarn lint

Run the build It is not necessary to generate build, since it is generated when you do PR to the master branch

yarn build

License

MIT