Skip to content

ankurrsinghal/vue-use-counter

Repository files navigation

About

This Vue hook was created as an sample to explain the process to create publishable Open Source Vue libraries.

Tutorial on Medium!

Usage Demo Stackblitz

Install

npm install vue-use-counter

Usage

<template>
  <div id="app">
    <div>
      {{ counter }}
    </div>
    <div>
      <button @click="handleClick">Inc</button>
    </div>
  </div>
</template>

<script>
import { useCounter } from 'vue-use-counter';

export default {
  name: 'App',
  setup() {
    const { counter, inc } = useCounter();

    function handleClick() {
      inc();
    }

    return {
      counter,
      handleClick,
    };
  },
};
</script>

About

A tutorial to publish a Vue library from scaffolding to release to npm registry.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published