InfoWindowExample.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <div>
  3. <InfoWindow
  4. :info-window-no="infoWindowNo" :multiple="true" :is-search-widget="false" :is-new-similar-assets="false"
  5. @get-select-model-data="getSelectModelData"
  6. >
  7. <template #customContent>
  8. <div>这是自定义内容</div>
  9. </template>
  10. </InfoWindow>
  11. </div>
  12. </template>
  13. <script>
  14. import InfoWindow from '@/info/index.js';
  15. export default {
  16. components: {
  17. InfoWindow,
  18. },
  19. props: {
  20. },
  21. data: function () {
  22. return {
  23. 'infoWindowNo': null,
  24. };
  25. },
  26. watch: {
  27. '$route': function (to, from) {
  28. this.getInfoWindowNo();
  29. },
  30. },
  31. mounted: function () {
  32. this.getInfoWindowNo();
  33. },
  34. methods: {
  35. /**
  36. * 获取查询窗口的编号
  37. */
  38. getInfoWindowNo: function () {
  39. if (this.$route.params != undefined) {
  40. var routeInfoWindowNo = this.$route.params.infoWindowNo;
  41. if (this.infoWindowNo != routeInfoWindowNo) {
  42. this.infoWindowNo = routeInfoWindowNo;
  43. console.log('open info window: ' + routeInfoWindowNo);
  44. }
  45. }
  46. },
  47. getSelectModelData: function (selected) {
  48. console.log(selected, '---');
  49. },
  50. },
  51. };
  52. </script>