sample-composables
v1.1.4
Published
Sample package to demonstrate the packaging of the vue3 composables
Downloads
3
Readme
Quick Setup
Create a new Vue 3 project.
In your Vue 3 project install this package using:
npm install sample-composables
or
yarn add sample-composables
This repo contains a composable called
sampleComposable
which can be used inApp.vue
as follows:<template> <img alt="Vue logo" src="./assets/logo.png" /> <button @click="increment()">{{ count }}</button> </template> <script lang="ts" setup> import { useSampleComposable } from "sample-composables"; const { count, increment } = useSampleComposable(); </script> <script lang="ts"> export default { name: "App", }; </script> <style> #app { font-family: Avenir, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-align: center; color: #2c3e50; margin-top: 60px; } </style>
Run
yarn serve
and click on the button rendered to see the count increment.