index.vue 940 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <JnpfRelationFormAttr v-model="value" :showField="showField" :relationField="relationField" :isStorage='isStorage'
  3. :type="type" @change="onChange" />
  4. </template>
  5. <script>
  6. import RelationFormAttr from '../RelationFormAttr/index.vue'
  7. export default {
  8. name: 'jnpf-popup-attr',
  9. inheritAttrs: false,
  10. props: {
  11. showField: {
  12. type: String,
  13. default: ''
  14. },
  15. relationField: {
  16. type: String,
  17. default: ''
  18. },
  19. type: {
  20. type: String,
  21. default: 'popupAttr'
  22. },
  23. isStorage: {
  24. type: Number,
  25. default: 0
  26. },
  27. },
  28. data() {
  29. return {
  30. value: '',
  31. }
  32. },
  33. watch: {
  34. modelValue: {
  35. immediate: true,
  36. handler(val) {
  37. this.value = val
  38. }
  39. },
  40. value(val) {
  41. this.$emit('update:modelValue', val)
  42. },
  43. },
  44. methods: {
  45. onChange(val) {
  46. this.$emit('change', val)
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .jnpf-relation-attr {
  53. width: 100%;
  54. }
  55. </style>