Mark
Mark

Reputation: 3738

In Vue, what is the meaning of #default in <template #default>?

I'm looking at an existing Vue code base and I am seeing <template> tags like:

<template #default>
<template #content>
<template #close>

I know each vue component is enclosed in the <template> tag but I've never seen #default or #content embedded within the template tag before. What is the purpose of this? I'm suspecting those # are customisable but you just have to define them? If that is the case, where would I be able to find it in a vue project? I'm assuming there is a standard location to store files like this in a vue project. Thank you.

Upvotes: 7

Views: 5011

Answers (2)

futur
futur

Reputation: 1843

# in a template tag is simply shorthand for v-slot:. See: https://vuejs.org/guide/components/slots.html#named-slots

Upvotes: 11

Liad
Liad

Reputation: 844

The # is a shorthand for vue v-slot:. can read a perfect example here

Upvotes: 6

Related Questions