onlineInformationBtn.vue 964 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <span class="btn" @click="btnClick" :class="topClass"> 在线咨询 </span>
  3. </template>
  4. <script>
  5. export default {
  6. name: "onlineInformation",
  7. props: {
  8. myType: {
  9. type: String,
  10. default: '1'
  11. }
  12. },
  13. methods: {
  14. btnClick() {
  15. this.$router.push({name: 'courseware'});
  16. }
  17. },
  18. computed: {
  19. topClass() {
  20. const obj = {
  21. 1: 'level_1',
  22. 2: 'level_2',
  23. 3: 'level_3',
  24. 4: 'level_4',
  25. }
  26. return [obj[this.myType]];
  27. }
  28. }
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .btn {
  33. &.level_1 {
  34. width: 154px;
  35. height: 47px;
  36. color: #00b96b;
  37. border-radius: 24px;
  38. padding: 10px 30px;
  39. background: #fff;
  40. border: 1px solid #00b96b;
  41. cursor: pointer;
  42. }
  43. &.level_2 {
  44. width: 154px;
  45. height: 47px;
  46. color: #fff;
  47. border-radius: 24px;
  48. padding: 10px 30px;
  49. background: #00B96B;
  50. border: 1px solid #00b96b;
  51. cursor: pointer;
  52. }
  53. }
  54. </style>