You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.3 KiB

  1. <template>
  2. <main>
  3. <header>
  4. <div>
  5. logo
  6. </div>
  7. <div>
  8. <span>
  9. click the map, or&nbsp;
  10. <button class="btn btn--primary" @click="showPicker">
  11. search
  12. </button>
  13. </span>
  14. </div>
  15. </header>
  16. <Map />
  17. <aside class="nav">
  18. <PickerOrigin v-show="isPickerVisible" :testlist="mountains" />
  19. </aside>
  20. </main>
  21. </template>
  22. <script>
  23. import PickerOrigin from '../components/PickerOrigin.vue'
  24. export default {
  25. components: { PickerOrigin },
  26. data () {
  27. return {
  28. mountains: [
  29. {
  30. slug: 'sluggy',
  31. title: 'titly'
  32. }
  33. ],
  34. isPickerVisible: false
  35. }
  36. },
  37. async fetch () {
  38. this.mountains = await fetch(
  39. 'https://api.nuxtjs.dev/mountains'
  40. ).then(res => res.json())
  41. },
  42. methods: {
  43. showPicker () {
  44. this.isPickerVisible = !this.isPickerVisible
  45. }
  46. }
  47. }
  48. </script>
  49. <style scoped>
  50. header {
  51. position: fixed;
  52. top: 0;
  53. width: 100vw;
  54. z-index: 402;
  55. display: flex;
  56. flex-direction: row;
  57. padding: 1rem;
  58. }
  59. .nav {
  60. position: fixed;
  61. top: 0;
  62. padding-top: 4rem;
  63. width: 100vw;
  64. z-index: 401;
  65. background: white;
  66. display: flex;
  67. flex-direction: column;
  68. justify-items: center;
  69. }
  70. .btn--nav-open {
  71. padding: 1rem;
  72. display: block;
  73. }
  74. </style>