How to use Pinia store in Vue 3

Pinia is the official state management solution for Vue 3, replacing Vuex with a more intuitive and TypeScript-friendly API. As the creator of CoreUI with extensive Vue development experience since 2014, I’ve migrated numerous applications from Vuex to Pinia for better developer experience. The setup involves creating a store with defineStore and using it within components through direct property access. Pinia provides excellent TypeScript support and eliminates the verbosity of traditional Vuex mutations.

Read More…

How to Use onMounted in Vue

The onMounted lifecycle hook in Vue 3 Composition API is called after the component has been mounted to the DOM. As the creator of CoreUI with over 11 years of Vue.js development experience, I use onMounted for DOM manipulation, API calls, and third-party library initialization that requires the component to be fully rendered. This hook is the Composition API equivalent of the mounted lifecycle hook in Options API.

Read More…

How to create a new Vue 3 project

Setting up a new Vue 3 project efficiently is essential for modern web development with improved performance, Composition API, and better TypeScript support. As the creator of CoreUI, a widely used open-source UI library, I’ve created numerous Vue 3 projects for enterprise dashboards and admin interfaces, leveraging the latest Vue ecosystem improvements. From my expertise, the most modern approach is to use Vite with npm create vue@latest command. This method provides lightning-fast development server, optimized builds, and seamless integration with the latest Vue 3 features.

Read More…