【fix ESLint】src/components/jero/JTreeDict

This commit is contained in:
zhaoxiao
2023-03-06 09:21:02 +08:00
parent 0d421fbc85
commit 4c3d2079ce
+5 -8
View File
@@ -90,13 +90,10 @@ export default {
},
computed: {
_attrs () {
let attrs
attrs = { ...this.$attrs }
return attrs
return { ...this.$attrs }
},
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
const vm = this
const result = Object.assign({},
this.$listeners
)
@@ -114,7 +111,7 @@ export default {
},
methods: {
loadViewInfo () {
if (!this.value || this.value == '0') {
if (!this.value || this.value + '' === '0') {
this.treeValue = null
} else {
const param = {
@@ -172,8 +169,8 @@ export default {
addChildren (pid, children, treeArray) {
if (treeArray && treeArray.length > 0) {
for (const item of treeArray) {
if (item.key == pid) {
if (!children || children.length == 0) {
if (item.key + '' === pid + '') {
if (!children || children.length === 0) {
item.leaf = true
} else {
item.children = children
@@ -186,7 +183,7 @@ export default {
}
},
handleTreeNodeValue (result) {
const storeField = this.field == 'code' ? 'code' : 'key'
const storeField = this.field + '' === 'code' ? 'code' : 'key'
for (const i of result) {
i.value = i[storeField]
i.isLeaf = !(!i.leaf)