SFooterToolBar2.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. const n = `<template>
  2. <div :class="['s-footer-tool-bar', { 'is-fixed': fixed }]">
  3. <div class="s-footer-tool-bar-left">
  4. <slot name="extra">{{ extra }}</slot>
  5. </div>
  6. <div class="s-footer-tool-bar-right">
  7. <slot />
  8. </div>
  9. </div>
  10. </template>
  11. <script setup>
  12. defineOptions({ name: 'SFooterToolBar' })
  13. defineProps({
  14. // 左区内容(无 #extra 插槽时生效)
  15. extra: {
  16. type: [String, Object],
  17. default: ''
  18. },
  19. // 是否贴底固定
  20. fixed: {
  21. type: Boolean,
  22. default: true
  23. }
  24. })
  25. <\/script>
  26. <style lang="less" scoped>
  27. .s-footer-tool-bar {
  28. display: flex;
  29. align-items: center;
  30. justify-content: space-between;
  31. height: 56px;
  32. padding: 0 24px;
  33. box-sizing: border-box;
  34. background: var(--s-bg-color-container);
  35. border-top: 1px solid var(--s-border-color-split);
  36. box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
  37. &.is-fixed {
  38. position: fixed;
  39. right: 0;
  40. bottom: 0;
  41. left: 0;
  42. z-index: 9;
  43. }
  44. .s-footer-tool-bar-left {
  45. flex: 1;
  46. min-width: 0;
  47. display: flex;
  48. align-items: center;
  49. gap: 8px;
  50. }
  51. .s-footer-tool-bar-right {
  52. flex: none;
  53. display: flex;
  54. align-items: center;
  55. gap: 8px;
  56. margin-left: 16px;
  57. }
  58. }
  59. </style>
  60. `;
  61. export {
  62. n as default
  63. };