yqform-edit 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yqform-edit",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "private": false,
5
5
  "main": "dist/yqform-edit.umd.min.js",
6
6
  "scripts": {
@@ -480,6 +480,8 @@ export default {
480
480
  mounted() { },
481
481
  computed: {
482
482
  question() {
483
+ if (!this.item) return {}
484
+ if (!this.item.rename && ['idPicture', 'file', 'image'].includes(this.item?.type)) this.item.rename = { connector: '-', keys: [] }
483
485
  if (this.item?.rename && Array.isArray(this.item?.rename)) {
484
486
  this.item.rename = { connector: '-', keys: this.item?.rename || [] }
485
487
  }
@@ -806,6 +808,9 @@ export default {
806
808
  if (treeObj.children?.length > 0) {
807
809
  this.dependsData.push(treeObj)
808
810
  }
811
+ if (this.dependsData.length === 1) {
812
+ this.dependsData = this.dependsData[0].children
813
+ }
809
814
  })
810
815
  this.showAddDepend = true
811
816
  // 题目切换时默认选中已经存在的依赖项
@@ -821,12 +826,11 @@ export default {
821
826
  setQuestionRename() {
822
827
  // 切换题目时清空已选项
823
828
  this.checkedRename = []
824
- if (this.question.rename.keys?.length > 0) {
829
+ if (this.question.rename?.keys?.length > 0) {
825
830
  this.checkedRename = this.question.rename.keys
826
831
  }
827
832
  },
828
833
  renameCheckChange() {
829
- console.log('[ this.checkedRename ] >', this.checkedRename)
830
834
  this.question.rename.keys = this.checkedRename
831
835
  },
832
836
  // 依赖选择发生变化的回调