Implement this is layout/default.vue
for page title like
- APP_NAME
- Hello - APP_NAME
<script setup>const config = useRuntimeConfig()useHead({ titleTemplate: (titleChunk) => { if (config.appName == titleChunk) return titleChunk return titleChunk ? `${titleChunk} - ${config.appName}` : config.appName; }})</script>
For pages
, just implement useHead
with title
. The following will generate title like Hello - APP_NAME
<script setup>useHead({ title: 'Hello'})</script>