Created
November 14, 2017 00:21
-
-
Save wolfhesse/c6a8b3750f03f6d8a97371a49b068e75 to your computer and use it in GitHub Desktop.
Revisions
-
wolfhesse created this gist
Nov 14, 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,71 @@ <template id="template-connect"> <div class="connect"> <div class="connect__searchPanel"> <div class="connect_speciesSelect"> <button @click="handleDogs">Dogs</button> <button @click="handleCats">Cats</button> </div> <div class="connect_Search"> <input type="text" :placeholder="searchPlaceholder"> {{ species }} </div> </div> </div> </template> <script> (function() { "use strict" Vue.component("vue-connect", { template: "#template-connect", data: function() { return { species: "dogs" } }, computed: { searchPlaceholder: function() { var self = this return self.species + " is computed.." } }, methods: { handleDogs: function() { //alert('dogs...') var self = this self.species = 'dog' }, handleCats: function() { //alert('cats...') var self = this self.species = 'cat' } }, }) })() </script> <style> .connect__searchPanel { margin-bottom: 2em; padding: 0.75em 0.5em; border: 3px solid #1a1a1a; border-radius: 6px; } .connect_speciesSelect { margin-bottom: 0.5em; } </style>