xm-link.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div>
  3. <a-form-model-item label="链接地址">
  4. <a-input v-model="component.attrFD.formItemProps.inputProps.href"></a-input>
  5. </a-form-model-item>
  6. <a-form-model-item label="链接名">
  7. <a-input v-model="component.attrFD.formItemProps.inputProps.hrefTitle" />
  8. </a-form-model-item>
  9. </div>
  10. </template>
  11. <script>
  12. import components from './_import-components/xm-link-import'
  13. export const metaInfo = {
  14. caption: '链接',
  15. component: {
  16. props: ['designerData'],
  17. render() {
  18. const { href, hrefTitle } = this.designerData.attrFD.formItemProps.inputProps
  19. return (
  20. <A href={href} target={'_blank'}>
  21. {hrefTitle}
  22. </A>
  23. )
  24. },
  25. },
  26. icon: 'link',
  27. order: 400,
  28. }
  29. export const fieldProps = {
  30. dataType: 'string',
  31. attrFD: { href: '111', formItemProps: { inputProps: { href: '', hrefTitle: '' } } },
  32. }
  33. export default {
  34. name: 'XmLink',
  35. components,
  36. data() {
  37. return {}
  38. },
  39. methods: {
  40. onChange(e, name) {
  41. this.component.attrFD.formItemProps.inputProps[name] = e.target.value
  42. },
  43. },
  44. }
  45. </script>
  46. <style module lang="scss">
  47. @use '@/common/design' as *;
  48. </style>