index.jsx 508 B

123456789101112131415
  1. import { ElImage } from 'element-plus'
  2. import { computed } from 'vue'
  3. import apiConfig from '@cip/request/apiConfig'
  4. import { getValueByTemplate } from '@cip/utils/util'
  5. import { generateProps } from '../helper/component-util'
  6. import { componentScheme } from './component.scheme'
  7. export default {
  8. props: generateProps(componentScheme),
  9. setup (props) {
  10. const realSrc = computed(() => {
  11. return getValueByTemplate(props.src, apiConfig)
  12. })
  13. return () => <ElImage src={realSrc.value}/>
  14. }
  15. }