address.blade.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. @once
  2. @push('css')
  3. <script src="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script>
  4. @endpush
  5. @endonce
  6. <search-address-modal ref="{{ $ref }}" @address-selected="{{ $addressSelected }}" inline-template>
  7. <div class="modal" tabindex="-1">
  8. <div class="modal-dialog modal-lg">
  9. <div class="modal-content">
  10. <div class="modal-header">
  11. <h5 class="modal-title">주소검색</h5>
  12. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  13. <span aria-hidden="true">&times;</span>
  14. </button>
  15. </div>
  16. <div class="modal-body">
  17. <div ref="searchAddress" style="width: 100%; height: 500px;"></div>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. </search-address-modal>
  23. @once
  24. @push('js')
  25. <script>
  26. Vue.component('search-address-modal', {
  27. data: function () {
  28. return {
  29. };
  30. },
  31. methods: {
  32. open: function () {
  33. var self = this;
  34. $(self.$el).modal('show');
  35. new daum.Postcode({
  36. oncomplete: function (data) {
  37. $(self.$el).modal('hide');
  38. self.$emit('address-selected', data);
  39. },
  40. width: '100%', height: '100%', maxSuggestItems: 5
  41. }).embed(this.$refs.searchAddress);
  42. }
  43. }
  44. });
  45. </script>
  46. @endpush
  47. @endonce