Created
August 28, 2017 16:02
-
-
Save lshapz/fabe516b720bdfb9099b811ee64a7f33 to your computer and use it in GitHub Desktop.
Revisions
-
lshapz created this gist
Aug 28, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ <style> ul { list-style-type: none; } </style> <div id="app"> <component :is="currentView"></component> <ul> <li role="presentation"> <a href="#" @click="currentView='my-component'">SHOW KITTY</a> </li> <li role="presentation"> <a href="#" @click="currentView='your-component'">SHOW PUPPY</a> </li> </ul> <div> <input type="text" v-model="input_val"> Input Value: <span v-text="input_val"></span> </div> </div> <script src="https://unpkg.com/vue"></script> <script> Vue.component('my-component', { template: '<div><h1>{{message}}</h1><iframe width="560" height="315" src="https://www.youtube.com/embed/zusn3JtpFDk" frameborder="0" allowfullscreen></iframe></div>', data: function(){ return { message: "LOOK AT THIS CAT" } } }) Vue.component('your-component', { template: '<div><iframe width="560" height="315" src="https://www.youtube.com/embed/LaYPWtNvJ-A" frameborder="0" allowfullscreen></iframe><h1>{{message}}</h1></div>', data: function(){ return { message: "LOOK AT THAT DOG" } } }) new Vue({ el: '#app', data: { currentView: "my-component", input_val: "fishes?" } }) </script>