16 lines
338 B
TypeScript
16 lines
338 B
TypeScript
import { ref } from 'vue'
|
|
import { defineStore } from 'pinia'
|
|
|
|
export const usePostsStore = defineStore('posts', () => {
|
|
const posts = ref('')
|
|
const setData = (value: string) => {
|
|
posts.value = value
|
|
}
|
|
const getData = () => {
|
|
return posts.value
|
|
}
|
|
return {
|
|
setData,
|
|
getData,
|
|
}
|
|
}) |