index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!-- 场馆漫游 -->
  2. <template>
  3. <div class="layout">
  4. <div class="title">珠海市红色革命遗址</div>
  5. <div class="cards">
  6. <swCard></swCard>
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. import swCard from "@/components/swCard";
  12. export default {
  13. components: {
  14. swCard,
  15. },
  16. data() {
  17. //这里存放数据
  18. return {};
  19. },
  20. //监听属性 类似于data概念
  21. computed: {},
  22. //监控data中的数据变化
  23. watch: {},
  24. //方法集合
  25. methods: {},
  26. //生命周期 - 创建完成(可以访问当前this实例)
  27. created() {},
  28. //生命周期 - 挂载完成(可以访问DOM元素)
  29. mounted() {},
  30. beforeCreate() {}, //生命周期 - 创建之前
  31. beforeMount() {}, //生命周期 - 挂载之前
  32. beforeUpdate() {}, //生命周期 - 更新之前
  33. updated() {}, //生命周期 - 更新之后
  34. beforeDestroy() {}, //生命周期 - 销毁之前
  35. destroyed() {}, //生命周期 - 销毁完成
  36. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  37. };
  38. </script>
  39. <style lang='less' scoped>
  40. //@import url(); 引入公共css类
  41. .layout {
  42. width: 100%;
  43. height: 100%;
  44. background: url("../../assets/images/cards-bg.png") center center no-repeat;
  45. background-size: 100% 100%;
  46. overflow: hidden;
  47. .title {
  48. font-size: 2vw;
  49. text-align: center;
  50. font-family: Source Han Sans CN;
  51. font-weight: bold;
  52. color: #9c0012;
  53. opacity: 1;
  54. margin-top:5vw;
  55. }
  56. .cards {
  57. margin: 2vw auto;
  58. }
  59. }
  60. @media screen and (max-width: 1024px) {
  61. .layout {
  62. width: 100%;
  63. height: 100%;
  64. background: url("../../assets/images/mobile-card-bg.png") center center no-repeat;
  65. background-size: 100% 100%;
  66. .title {
  67. margin-top:20vw;
  68. font-size: 5vw;
  69. }
  70. .cards {
  71. margin: 2vw auto;
  72. }
  73. }
  74. }
  75. </style>