BaseModal.vue 1010 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. </template>
  3. <script>
  4. import bus from '@/assets/js/event.js'
  5. import baseMixin from '@/mixin/baseMixin'
  6. export default {
  7. mixins: [baseMixin],
  8. data () {
  9. return {
  10. menuId: this.$route.name,
  11. }
  12. },
  13. props: {
  14. layerid: {
  15. type: String,
  16. default: null
  17. }
  18. },
  19. computed: {
  20. curUser() {
  21. return this.$parent.$store.state.user.user;
  22. }
  23. },
  24. watch: {
  25. },
  26. mounted () {
  27. this.$nextTick(() => {
  28. if (this.layerid) {
  29. document.getElementById(this.layerid).onclick = function (e) {
  30. bus.$emit('selectClose', this);
  31. };
  32. }
  33. });
  34. },
  35. methods: {
  36. close: function () {
  37. if (this.layerid) {
  38. this.$layer.close(this.layerid);
  39. } else {
  40. this.backListView(false);
  41. }
  42. },
  43. },
  44. destroyed () {
  45. }
  46. }
  47. </script>