Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

vue.js slots

Parent Component :
<template>
  <Child>
    <template v-slot:header>
      <h1>Header </h1>
    </template>

    <template v-slot:content>
      <h1> Content </h1>
    </template>

    <template v-slot:footer>
      <h1>Footer</h1>
    </template>
  </Child>
</template>

Child component :

<template>
  <slot name="header">Default Value</slot>
  <slot name="content">Default Value</slot>
  <slot name="footer">Default Value</slot>
</template>
Comment

what is slot in vue.js

// app.vue
<template>
  <current-user>
    <template v-slot:default="slotProps">{{ slotProps.user.firstName }}</template>    
  </current-user>
</template>
Comment

PREVIOUS NEXT
Code Example
Javascript :: check checkbox based on value using jquery 
Javascript :: javascript object to query params 
Javascript :: how to append value to input field using jquery 
Javascript :: iiee i 
Javascript :: vite.config.js 
Javascript :: square root javascript 
Javascript :: how to change user password firebase 
Javascript :: how to get day name in moment js 
Javascript :: Reached heap limit Allocation failed - JavaScript heap out of memory nodejs 
Javascript :: authfunctions express 
Javascript :: href="javascript:void(null);" 
Javascript :: .children javascript 
Javascript :: moment().toDate(); 
Javascript :: bigger or equal javascript 
Javascript :: datatable child rows without ajax 
Javascript :: javascript stop the form from reloading 
Javascript :: express response setTimeout 
Javascript :: how to delete a reply in discord.js 
Javascript :: javascript remove innerhtml 
Javascript :: localstorage clear item 
Javascript :: regular expression for thousand separator 
Javascript :: inner html jquery 
Javascript :: jquery telephone input mask 
Javascript :: how to make one line if in js 
Javascript :: Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false` 
Javascript :: ionic capacitor keyboard push content up 
Javascript :: react js get screen size 
Javascript :: app.use public 
Javascript :: [PrivateRoute] is not a <Route component. All component children of <Routes must be a <Route or <React.Fragment 
Javascript :: fetch method in js 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =