সম্পাদনা
<!DOCTYPE html> <html> <body> <div id="app"> <p>কাউন্ট: {{counter.count}}</p> <button @click="counter.count++">বৃদ্ধি</button> </div> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script src="https://unpkg.com/pinia@3/dist/pinia.iife.js"></script> <script> const {createApp} = Vue; const {createPinia, defineStore} = Pinia; const useCounterStore = defineStore("counter", { state: () => ({ count: 0 }) }); const app = createApp({ setup() { const counter = useCounterStore(); return {counter}; } }); app.use(createPinia()); app.mount("#app"); </script> </body> </html>
পূর্বরূপ