Skip to content

capitalize

The module capitalize is a function that adds a capital letter to a string

formatted value: String value
vue
<script lang="ts" setup>
import { capitalize } from 'maz-ui'
import { computed, ref } from 'vue'

const stringValue = ref('string value')

const stringFormatted = computed(() =>
  capitalize(stringValue.value),
)
</script>

<template>
  <MazInput v-model="stringValue" />

  <div
    style="padding: 16px; margin-top: 16px; background-color: hsl(var(--maz-background-300));"
  >
    {{ stringFormatted }}
  </div>
</template>