Basic Prop Validation

Demonstrate how to define a Vue.js 3 component with basic prop validation including type checks.
    <h1>{{ title }}</h1>
    <p>{{ message }}</p>

import { defineComponent, PropType } from 'vue';

export default defineComponent({
  name: 'ExampleComponent',
  props: {
    // Define the prop 'title' of type String with a required validation
    title: {
      type: String,
      required: true
    // Define the prop 'message' of type String with a default value
    message: {
      type: String,
      default: 'Default message'

div { text-align: center; }
h1 { color: #333; }
p  { color: #666; }
This Vue.js 3 component example named 'ExampleComponent' defines two props with basic validation. The 'title' prop is of type String and is required. The 'message' prop is also of type String, and it has a default value of 'Default message'. The template section renders both title and message within a div, styled with center-aligned text.