`). This setup ensures that FLIP animations function as expected because block elements support CSS transforms.
```vue
{{ item.name }}
```
--------------------------------
### Calling Vue.js Composables in Lifecycle Hooks
Source: https://github.com/vuejs-ai/skills/blob/main/skills/vue-best-practices/reference/composable-call-location-restrictions.md
Shows an example of correctly calling a composable within a lifecycle hook like `onMounted`. This is permissible because the component's execution context is maintained during lifecycle hook execution, allowing for proper hook registration.
```vue
```
--------------------------------
### Handling Slots with Render Functions in Vue setup()
Source: https://github.com/vuejs-ai/skills/blob/main/skills/vue-best-practices/reference/rendering-render-function-return-from-setup.md
Shows how to correctly render slots when using render functions with Vue's Composition API. The `slots` object provided to `setup()` must be called within the returned render function to ensure slot content is rendered appropriately.
```javascript
import { h, ref } from 'vue'
export default {
setup(props, { slots }) {
const count = ref(0)
return () => h('div', [
h('p', `Count: ${count.value}`),
// Slots must also be called inside the render function
slots.default?.()
])
}
}
```
--------------------------------
### Correct Pinia and Router Plugin Order in Vue.js
Source: https://github.com/vuejs-ai/skills/blob/main/skills/vue-pinia-best-practices/reference/pinia-no-active-pinia-error.md
Ensures Pinia is installed before the router to prevent errors when router guards access Pinia stores. This is crucial for applications using both Pinia for state management and Vue Router for navigation.
```javascript
// main.js - WRONG ORDER
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import router from './router' // Router uses a store in navigation guard
import App from './App.vue'
const app = createApp(App)
// WRONG: Router is installed first, but its guards use stores
app.use(router) // Router guard calls useAuthStore() - FAILS!
app.use(createPinia())
app.mount('#app')
```
```javascript
// main.js - CORRECT ORDER
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import router from './router'
import App from './App.vue'
const app = createApp(App)
// CORRECT: Pinia installed before anything that uses stores
app.use(createPinia())
app.use(router) // Now router guards can safely use stores
app.mount('#app')
```