vue3-templates

Guide Vue 3 template syntax for SSR applications with directives and bindings.

3|Updated Jan 14, 2023
One-click install
npx skills add https://github.com/e-xode/vue-ssr --skill vue3-templates
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue3-templates
Source: https://github.com/e-xode/vue-ssr/tree/main/.claude/skills/vue3-templates
Command: npx skills add https://github.com/e-xode/vue-ssr --skill vue3-templates

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents common Vue 3 template mistakes that cause hydration issues, broken rendering, slow UI behavior, or incorrect form state—especially in an SSR context.

Core Features & Use Cases

  • Correct directive usage: interpolation, v-bind/:, v-on/@, and conditional rendering with v-if/v-else(-if) and visibility toggling with v-show.
  • Reliable list rendering: proper v-for usage with a mandatory stable :key, and avoiding illegal patterns like mixing v-if and v-for on the same element.
  • Safe bindings and events: class/style binding mechanics, event handling with modifiers, and native-element v-model with .lazy, .number, and .trim.
  • Rendering best practices: SSR determinism guidance and safer text rendering rules (avoid v-html unless sanitized).

Quick Start

Ask the AI to review your Vue 3 SSR template and rewrite it to follow the project rules for v-for keys, v-if placement, native v-model modifiers, and event/class/style bindings.

Frequently Asked Questions about vue3-templates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Vue 3 SSR template break during hydration?

Vue 3 SSR hydration breaks when templates violate deterministic rendering constraints, such as using unstable v-for keys or mixing v-if with v-for on the same element. Enforcing stable keys and safe text rendering prevents mismatched DOM trees.

How do I use native v-model with modifiers in Vue 3 templates?

Native v-model in Vue 3 templates supports .lazy, .number, and .trim modifiers to synchronize form input state. Binding directly to native elements ensures correct form state and avoids slow UI behavior during SSR rendering.

What is the correct way to render lists with v-for in an SSR application?

Rendering lists with v-for in an SSR application requires assigning a stable :key to each item. You must avoid mixing v-if and v-for on the same element to maintain deterministic output and prevent hydration mismatches.

Can I use v-html safely in Vue 3 server-side rendered components?

Using v-html in Vue 3 server-side rendered components is discouraged unless the content is strictly sanitized. Unsafe v-html usage introduces security vulnerabilities and can break deterministic SSR rendering constraints.

How do I bind classes and styles with shorthand directives in Vue 3?

Vue 3 binds classes and styles using the v-bind shorthand `:` directive. Correct usage ensures deterministic SSR rendering by applying stable class and style objects or arrays without relying on client-side only calculations.

Does Vue 3 allow v-if and v-for on the same element?

Vue 3 prohibits using v-if and v-for on the same element. This illegal pattern causes incorrect conditional rendering and hydration errors, so you should separate them by wrapping the v-for loop in a computed property or a wrapper element.