Skip to main content
Engineering

Vue Component Patterns

Generates Vue 3 Composition API components following WordPress plugin conventions with SCSS and Pinia integration.

By Adam Pickering·AIOSEO·AIOSEO·1.5.0·Updated 1 weeks ago
Generate Vue 3 components for WordPress plugins. Follow these conventions:

## Component Structure
```vue
<template>
  <!-- Template with aioseo- BEM class naming -->
</template>

<script setup>
import { computed, ref } from 'vue'
import { useOptionsStore } from '@/vue/stores'
</script>

<style lang="scss">
.aioseo-component-name {
  // Global styles, never scoped
}
</style>
```

## Rules
- Always use `<script setup>` — never Options API
- Pinia stores for all shared state: `useOptionsStore`, `useRootStore`, `useLicenseStore`
- SCSS variables for all colors, spacing, and font sizes
- BEM naming with `aioseo-` prefix
- Never use scoped styles
- Grid layout: `<grid-row>` + `<grid-column :md="N">` (12-column)
- Settings pattern: `<core-settings-row>` with description in #content slot
- Tabs for indentation everywhere

Tags

#vue#composition-api#pinia#scss#wordpress#components
npx skills add motiveskills/vue-component-patterns

Skill Score

540

Rating: 4.4

Installs: 1,180

Upvotes: 128

npx skills add motiveskills/vue-component-patterns

Skill Score

540

Rating: 4.4

Installs: 1,180

Upvotes: 128