在 Vue(类星体)中没有分配 ScopedSlots 的问题,数据被传递到数据透视表,数组是从 json 数据表的标题构建的,错误和代码如下,感谢帮助。
Error in render: "TypeError: scopedSlots is not a function" - Found in DraggableAttribute
scopedSlots is not a function - at pvtAttr:
scopedSlots: {
pvtAttr: props => h('slot', scopedSlots(props))
},
示例代码:
<template>
<q-page class="q-pa-md">
<vue-pivottable-ui
:data="pivotData"
:aggregatorName="aggregatorName"
:rendererName="rendererName"
:rows="rows"
:cols="cols"
:vals="vals"
:row-total="true"
:col-total="true">
</vue-pivottable-ui>
</q-page>
</template>
<script>
import {VuePivottableUi} from 'vue-pivottable'
import 'vue-pivottable/dist/vue-pivottable.css'
let jsonData = require('JSONFILE)
export default {
name: 'PivotTable',
components: {
VuePivottableUi
},
data() {
return {
pivotData: jsonData,
aggregatorName: 'Sum',
rendererName: 'Table Heatmap',
rows: ["row_header1"],
cols: ['col_header'],
vals: ['values'],
}
},
mounted() {
console.log(this.pivotData)
}
}
</script>