This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="my-app"> | |
<p>Introduction text</p> | |
<share-buttons/> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="my-app"> | |
<p>Introduction text</p> | |
<share-buttons gplus="false"/> | |
</div> | |
<template id="share-buttons-template"> | |
<div id="share-buttons"> | |
<a href="#" @click.prevent="share" v-if="facebook">Facebook</a> | |
<a href="#" @click.prevent="share" v-if="twitter">Twitter</a> | |
<a href="#" @click.prevent="share" v-if="gplus">Google+</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
... | |
<my-vue-component/> | |
<!-- allows multiples instances of the same component --> | |
<my-vue-component my-prop="true"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyElement extends HTMLElement { | |
constructor() { | |
super(); | |
this.msg = 'Hello, World!'; | |
} | |
connectedCallback() { | |
this.innerHTML = `<p>${this.msg}</p>`; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template id="share-buttons-template"> | |
<div id="share-buttons"> | |
<a href="#">Facebook</a> | |
<a href="#">Twitter</a> | |
</div> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="import" href="share-buttons.html"> | |
... | |
</head> | |
<body> | |
... | |
<share-buttons></share-buttons> | |
... | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.dispatchEvent(new Event('content-shared')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Custom Elements</title> | |
<script type="text/javascript"> | |
class FirstCustomElement extends HTMLElement { | |
constructor() { | |
super(); | |
console.log('constructor'); | |
} |
OlderNewer