Problem Statement
What are filters in Vue and how should you format text in Vue 3?
Explanation
In Vue 2, template filters ({{ msg | capitalize }}) format values inline. Vue 3 removed template filters; prefer computed properties or formatting methods and pipes via function calls in templates. This keeps logic explicit and type-friendly.
Code Solution
SolutionRead Only
// Vue 3 example
<template>{{ capitalize(name) }}</template>
<script setup>
function capitalize(s:string){ return s.charAt(0).toUpperCase() + s.slice(1) }
</script>Practice Sets
This question appears in the following practice sets: