使用datav组件明明设置了config值,但是获取不到
报错:Cannot read properties of undefined (reading 'config')at eval
```javascript
<template>
<dv-scroll-board ref="scrollBoard" :config="config" style="width:100%;height:200px;opacity: 0.8;" id="gdkb"/>
</template>
<script>
import axios from 'axios'
export default {
name: "Gd-kb",
components: {},
data() {
return {
config: {
header: ['序号', '工作令号', 'MC/MO','计划数量','完成数量','直通数量','完成率','直通率','稼动率','一次检完成率','质量达标','配料'],
data: [
['1', 'J2022-1021-2模块', 'M000099702','2000','200','196','10%','98%','85%','99%','98%','完成'],
['2', 'J2022-1021-2模块', 'M000099703','3000','200','196','10%','98%','85%','99%','98%','完成'],
],
columnWidth: [150,400,400,200,200,200,200,200,200,400,200,200,200],
align: ['center'],
carousel: 'page',
headerBGC:'#0A2732',
oddRowBGC:'#0A2732'
}
}
},
methods:{
getgdkb(){
var url = "http://172.16.100.26/InputScoresDetailsDevelopedSunrise_Web.ashx?urlflag=3&sId=155"
var worktime={
ClassName:"",
StartWorkTime:"",
EndWorkTime:""
}
var worktimes=new Array()
var s={
'LineName': 'DIPZ-L6 WL',
'WorkTime': worktimes
}
worktimes.pop(worktime)
axios.post(url, JSON.stringify(s)).then(function (res) {
console.log(res.data.WorkOrderData)
//if (res.data.code == 200) {
//this.config.data.length=0;
this.config.data = res.data.WorkOrderData
//this.config = { ...this.config };
this.$refs['scrollBoard'].updateRows(this.config.data)
//}
}).catch(function (error) {
console.log(error)
})
}
},
mounted(){
this.getgdkb()
}
}
</script>
报错:
Cannot read properties of undefined (reading 'config') at eval