SHARE
TWEET

Untitled

a guest Oct 14th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <template>
  2.     <div class="relative">
  3.         <Dropdown
  4.             :options="$page.places.edges.map(e => e.node)"
  5.             v-on:selected="submit"
  6.             :disabled="false"
  7.             name="dropdown"
  8.             :maxItem="600"
  9.             class="text-left"
  10.             placeholder="Please select an option">
  11.         </Dropdown>
  12.         <button type="submit" v-on:click.prevent="submit()" class="relative z-50">Go</button>
  13.     </div>
  14. </template>
  15.  
  16. <page-query>
  17.     query Posts {
  18.     places: allPlace ( sortBy: "title", order: ASC) {
  19.         edges {
  20.         node {
  21.             id
  22.             path
  23.             title
  24.             name
  25.         }
  26.         }
  27.     }
  28.     }
  29. </page-query>
  30.  
  31. <script>
  32.     import Dropdown from 'vue-simple-search-dropdown';
  33.  
  34.     export default {
  35.     components: {
  36.         Dropdown
  37.     },
  38.     methods: {
  39.         submit(){
  40.         this.$router.push(this.matches[selected.path])
  41.         }
  42.     }
  43.     }
  44. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top