-
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.
-
Notifications
You must be signed in to change notification settings - Fork 0
noopurphalak/sample-composables
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published