Image.vue 680 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <div class="wrap">
  3. <a-image class="image" :src="src" style="width: auto; height: 70px" />
  4. </div>
  5. </template>
  6. <script lang="ts">
  7. import { Image } from 'ant-design-vue';
  8. import { defineComponent, toRefs } from 'vue';
  9. const props = {
  10. src: { type: String, default: '' },
  11. };
  12. export default defineComponent({
  13. components: { aImage: Image },
  14. props,
  15. setup(props) {
  16. return {
  17. ...toRefs(props),
  18. };
  19. },
  20. });
  21. </script>
  22. <style scoped>
  23. .wrap {
  24. display: flex;
  25. justify-content: space-around;
  26. width: 100%;
  27. height: 80px;
  28. align-items: center;
  29. border: 1px solid #ddd;
  30. border-radius: 2px;
  31. }
  32. </style>