robin-editor-header.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="head">
  3. <view class="btn left" @tap="cancel" v-if="labelCancel">{{ labelCancel }}</view>
  4. <view class="btn right" @tap="save" v-if="labelConfirm">{{ labelConfirm }}</view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. name: 'robin-editor-header',
  10. props: {
  11. labelCancel: {
  12. type: String,
  13. default: '取消'
  14. },
  15. labelConfirm: {
  16. type: String,
  17. default: '确定'
  18. }
  19. },
  20. methods: {
  21. cancel: function() {
  22. this.$emit('cancel');
  23. },
  24. save: function() {
  25. this.$emit('save');
  26. }
  27. }
  28. };
  29. </script>
  30. <style lang="scss" scoped>
  31. .head {
  32. display: flex;
  33. justify-content: space-between;
  34. width: 100%;
  35. height: 100%;
  36. border-bottom: 1px #eee solid;
  37. // box-shadow: 1px 0 2px rgba(0, 0, 0, 0.1);
  38. background: #fff;
  39. .btn {
  40. display: block;
  41. width: 150upx;
  42. height: 80upx;
  43. line-height: 80upx;
  44. font-size: 30upx;
  45. color: #666;
  46. padding-left: 20upx;
  47. text-align: center;
  48. &.left {
  49. float: left;
  50. }
  51. &.right {
  52. float: right;
  53. }
  54. }
  55. }
  56. </style>