slogan.vue 964 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div>
  3. <div class="slogan-div"><p class="slogan" >{{ slogan }}</p></div>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. name: 'Slogan',
  9. data () {
  10. return {
  11. slogan: ''
  12. }
  13. },
  14. methods: {
  15. /**
  16. * @description:获取寄语
  17. */
  18. getSlogan: function () {
  19. var that = this
  20. this.$axios
  21. .get('/admin/getSlogan')
  22. .then(res => {
  23. that.slogan = res.data
  24. })
  25. }
  26. },
  27. mounted: function () {
  28. this.getSlogan()
  29. }
  30. }
  31. </script>
  32. <style scoped>
  33. .slogan-div {
  34. position:absolute; /*父元素设置成relative*/
  35. top: 0.1%;
  36. left: 0.1%;
  37. height: 224px;
  38. width: 145px;
  39. writing-mode: vertical-lr; /*设置文字纵向*/
  40. box-sizing: border-box; /*固定div大小*/
  41. line-height: 35px;
  42. font-size: 18px;
  43. font-family: "Source Han Sans CN";
  44. white-space: pre-wrap;
  45. /*float: left;*/
  46. }
  47. .slogan {
  48. margin-top: 30px;
  49. color: #475837;
  50. }
  51. </style>