当前位置:   article > 正文

Nuxt.js实战 下_nuxt data()

nuxt data()

8.界面优化
8.1 优化首页

我们发现,在项目启动后,页面的头部和尾部已经能正常显示,但页面中间的文字,不是我们想要的。 如果想修改这里的文字或图片,则可以在项目根目录下的pages目录中,修改index.vue,因为当前项目默认访问的就是这个文件。
  1. <template>
  2. <section class="container">
  3. <div>
  4. <app-logo/>
  5. <h1 class="title">
  6. 黑马旅游网
  7. </h1>
  8. <h2 class="subtitle">
  9. 你最值得信赖的旅游指导
  10. </h2>
  11. <div class="links">
  12. <a
  13. href="http://www.itcast.cn/"
  14. target="_blank"
  15. class="button--green">传智播客</a>
  16. <a
  17. href="http://www.itheima.com/"
  18. target="_blank"
  19. class="button--green">黑马程序员</a>
  20. </div>
  21. </div>
  22. </section>
  23. </template>
  24. <script>
  25. import AppLogo from '~/components/AppLogo.vue'
  26. export default {
  27. components: {
  28. AppLogo
  29. }
  30. }
  31. </script>
  32. <!-- css样式,可以根据自己选择进行调整 -->
  33. <style>
  34. .container {
  35. min-height: 100vh;
  36. display: flex;
  37. justify-content: center;
  38. align-items: center;
  39. text-align: center;
  40. }
  41. .title {
  42. font-family: "Quicksand""Source Sans Pro",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; /* 1 */
  43. display: block;
  44. font-weight: 300;
  45. font-size: 70px;
  46. color: #35495e;
  47. letter-spacing: 1px;
  48. }
  49. .subtitle {
  50. font-weight: 300;
  51. font-size: 20px;
  52. color: #526488;
  53. word-spacing: 5px;
  54. padding-bottom: 15px;
  55. }
  56. .links {
  57. padding-top: 15px;
  58. }
  59. </style>
修改后,效果如图所示 
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/971332
推荐阅读
相关标签
  

闽ICP备14008679号