Skip to content

Instantly share code, notes, and snippets.

Avatar

Tuan Nguyen Duy ndtuan412

View GitHub Profile
@ndtuan412
ndtuan412 / pass-slots.md
Created Nov 28, 2019 — forked from loilo/pass-slots.md
Vue: Pass Slots through from Parent to Child Components
View pass-slots.md

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }
    
    const B = {
@ndtuan412
ndtuan412 / app.html
Last active Dec 29, 2016 — forked from anonymous/app.html
DI inheritance
View app.html
<template>
<require from="./test"></require>
<require from="./test2"></require>
<require from="./test3"></require>
<h1>${message}</h1>
<test>
<template replace-part="name">
, replaced
<button click.delegate="func()">click</button>
${title}
View contact.html
<template>
<div class="contact box">
<h3>Contact</h3>
<div class="form-box form-horizontal">
<div class=" form-inline">
<label for="phone">Phone</label>
<input type="phone" class="form-control" name="phone" placeholder="Phone" value.two-way="phone">
</div>
</div>
</div>
View contact.html
<template>
<div class="contact box">
<h3>Contact</h3>
<div class="form-box form-horizontal">
<div class=" form-inline">
<label for="phone">Phone</label>
<input type="phone" class="form-control" name="phone" placeholder="Phone" value.two-way="phone">
</div>
</div>
</div>
You can’t perform that action at this time.