3.0.0 • Published 3 years ago

vue-uuid v3.0.0

Weekly downloads
19,247
License
MIT
Repository
github
Last release
3 years ago

Vue UUID

Add UUID to Vue instance.

Build Status

Install

Installation is very easy, you just need to install using NPM or Yarn.

npm i vue-uuid

Vue's use method will do the trick adding to Vue.

import { createApp } from "vue";
import withUUID from "vue-uuid";

const app = withUUID(
  createApp({
    // ...
  }),
);

Usage

After installation $uuid is available on instance, so you can use inside components template and script, like the example below.

<template>
  <div class="uuid-panel">
    <h3 class="uuid">{{ uuid }}</h3>
    <button
      class="button"
      @click="uuid = $uuid.v1()"
    >Generate V1</button>
    <button
      class="button"
      @click="uuid = $uuid.v3()"
    >Generate V3</button>
    <button
      class="button"
      @click="uuid = $uuid.v4()"
    >Generate V4</button>
    <button
      class="button"
      @click="uuid = $uuid.v5("Name 1", NAMESPACE)"
    >Generate V5</button>
  </div>
</template>

<script>
  import { uuid } from 'vue-uuid'; // uuid object is also exported to things
                                   // outside Vue instance.

  const NAMESPACE = "65f9af5d-f23f-4065-ac85-da725569fdcd";

  export default {
    data () {
      return {
        NAMESPACE,
        uuid: uuid.v1(),
        v1: this.$uuid.v1(),
        v3: this.$uuid.v3(),
        v4: this.$uuid.v4(),
        v5: this.$uuid.v5("Name 2", NAMESPACE)
      };
    }
  };
</script>
bpmn-editor-wjbpmn-editor-wujinhrpro7web@itnikc/legend-bpmn-editorldns20201130ldns_white02ldns_whiteboard04ldns_whiteboard06ldns_whiteboard09ldns_whiteboard10ldns_whiteboard00ldns_whiteboard02ldns_whiteboard03ldns_whiteboard30ldns_whiteboard31ldns_whiteboard32ldns_whiteboard33ldns_whiteboard34ldns_whiteboard37ldns_whiteboard38ldns_whiteboard44ldns_whiteboard46ldns_whiteboard47ldns_whiteboard49ldns_whiteboard50ldns_whiteboard62ldns_whiteboardlegend-bpmn-editor@smiledirectclub/smile-components-vuehs-ui-testau-nuxt-module-zero@bigpicturemedical/medkit-component-inputh-designer@infinitebrahmanuniverse/nolb-vue-ucrownboot-flow-vuezxr-new-componentszxr-new-renders@everything-registry/sub-chunk-3096wx-vue-commontaixu-flow-designvue-m-dataviewerwfdesignerxing-form-enginexiatianwhitedeyzetaxiatianzetavue-dataviewer@curi-bio/mantarray-frontend-components@ruihortafigueiredo/vue-video-tagklklklkquick-birobotmanager-mqtt-appspn-utilitysqltools-ality-customizationui-crmtng-form-designertng-platform-designertng-platform-designer-v2@anvyst/vue-fieldhandlers@agency-undone/au-nuxt-module-zero@central-design-system/store@abunesar87/g-chatboty-designervue-tree-table-componentvue-treantvue-workflow-modelerzeta-up-test09zeta-up-test10zeta-up-test11zkzc-bpmn@genpact/genome.mfe.solidify-app@genpact/genome.mfe.academy-app@kongponents/kcard@kongponents/ktable@kongponents/ktextarea@kongponents/kmenu@kongponents/kpop@kongponents/kselect@kongponents/kinput@khoren.markosyan/vue@legend-hk/legend-bpmn-editor@lffcbr/kontato-chat@napopravku/vue3-ui@prontip.ke/vue-chartjs@phatnt/base-controlmodify-uisantech-galaxy-componentsantech-logistics-trackingreminder-cardrecommendation-cardsmart-flow-designsmart-flow-design-demogpmctestibc-web-commonhui-plughl-corehcmars-webui-videolh-designlexx-ui-vuelogistics-tracking
3.0.0

3 years ago

2.1.0

3 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

8 years ago

0.1.2

8 years ago

0.1.0

8 years ago