fix-window.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="fix-window">
  3. <top-window class="fix-window-top" />
  4. <view class="fix-window-button" @click="tiggerWindow"></view>
  5. <view v-show="visible" class="fix-window--mask" @click="tiggerWindow"></view>
  6. <left-window v-show="visible" class="fix-window--popup" />
  7. </view>
  8. </template>
  9. <script>
  10. import topWindow from '../../windows/topWindow.vue'
  11. import leftWindow from '../../windows/leftWindow.vue'
  12. export default {
  13. components: {
  14. topWindow,
  15. leftWindow
  16. },
  17. data() {
  18. return {
  19. visible: false
  20. };
  21. },
  22. methods: {
  23. tiggerWindow() {
  24. this.visible = !this.visible
  25. }
  26. }
  27. }
  28. </script>
  29. <style>
  30. .fix-window-button {
  31. width: 30px;
  32. height: 30px;
  33. opacity: 0.5;
  34. position: fixed;
  35. top: 40px;
  36. left: 20px;
  37. z-index: 999;
  38. }
  39. .fix-window-top {
  40. width: 100%;
  41. position: fixed;
  42. top: 25px;
  43. left: 0;
  44. z-index: 999;
  45. }
  46. .fix-window--mask {
  47. position: fixed;
  48. bottom: 0px;
  49. top: 25px;
  50. left: 0px;
  51. right: 0px;
  52. background-color: rgba(0, 0, 0, 0.4);
  53. transition-duration: 0.3s;
  54. z-index: 997;
  55. }
  56. .fix-window--popup {
  57. position: fixed;
  58. top: 85px;
  59. left: 0;
  60. /* transform: translate(-50%, -50%); */
  61. transition-duration: 0.3s;
  62. z-index: 998;
  63. }
  64. </style>