18
composables/counter.js
Normal file
18
composables/counter.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
|
||||
export default function useCounter() {
|
||||
|
||||
const count = ref(0)
|
||||
|
||||
|
||||
function increment() {
|
||||
count.value++
|
||||
}
|
||||
|
||||
return {
|
||||
count,
|
||||
increment
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user