const stores = {}
export function getCounterStore(key) {
if (!stores[key]) stores[key] = defineStore(key, storeDefinition)
return stores[key]()
}
import { defineStore } from 'pinia'
const storeDefinition = {
state: () => {
return { count: 0 }
},
actions: {
increment() {
this.count++
},
},
}
export const useCounter1Store = defineStore('counter1', storeDefinition)
export const useCounter2Store = defineStore('counter2', storeDefinition)
export const useCounter3Store = defineStore('counter3', storeDefinition)
export const useCounter4Store = defineStore('counter4', storeDefinition)
export const useCounter5Store = defineStore('counter5', storeDefinition)
export const useCounter6Store = defineStore('counter6', storeDefinition)
php artisan make:migration <migration_name>
в начале имени файла идет дата и время в формате, который при сортировке отсортируется нормально.