Crumbs.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div class="container clearfix" :style="{'minWidth':minWidth?minWidth:'980px'}">
  3. <img v-if="linkTo" class="return-btn fl" src="../../images/return.png" alt="返回按钮" @click="goBack">
  4. <h4 class="fl">{{title}}</h4>
  5. <div class="contents fr">
  6. <slot></slot>
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. name: 'crumbs',
  13. props: ['title','linkTo','minWidth','param'],//minWidth-有些头部选项比较多,最小宽度需要调整
  14. data: function () {
  15. return {}
  16. },
  17. methods:{
  18. goBack(){
  19. this.$router.push({
  20. name:this.linkTo,
  21. params:this.param
  22. });
  23. }
  24. }
  25. }
  26. </script>
  27. <style lang="less" scoped>
  28. @import "../../less/common.less";
  29. div.container {
  30. width: calc(100% - 50px);
  31. height: 40px;
  32. background: #fff;
  33. padding: 0 20px 0 30px;
  34. margin-bottom: 20px;
  35. line-height: 40px;
  36. position: absolute;
  37. z-index: 5;
  38. // min-width: 980px;
  39. }
  40. .return-btn{
  41. margin: 11px 5px 0 0;
  42. cursor: pointer;
  43. }
  44. h4 {
  45. font-size: 15px;
  46. }
  47. </style>