index.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <div :class="{'hidden': !hidden.status}" @click="hidden.status=false" class="heibox">
  3. <div class="imgs" @click.stop="">
  4. <img :src="urls" alt="" class="img">
  5. </div>
  6. </div>
  7. </template>
  8. <script>
  9. import {
  10. scrollTo
  11. } from '@/utils/scroll-to'
  12. export default {
  13. name: 'BigPicture',
  14. props: {
  15. urls: {
  16. default: '',
  17. type: String
  18. },
  19. hidden: {
  20. type: Object,
  21. default: () => {
  22. return {
  23. status: ''
  24. }
  25. }
  26. }
  27. },
  28. methods: {
  29. }
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .heibox {
  34. width: 100vw;
  35. height: 100vh;
  36. background-color: rgba(0,0,0,.8);
  37. position: fixed;
  38. z-index: 99999;
  39. top: 0;
  40. left: 0;
  41. .imgs{
  42. width: 80%;
  43. position: absolute;
  44. left: 50%;
  45. height: auto;
  46. top: 50%;
  47. transform: translate(-50%,-50%);
  48. .img{
  49. width: 100%;
  50. object-fit: contain;
  51. }
  52. }
  53. }
  54. .hidden {
  55. display: none;
  56. }
  57. </style>