简体   繁体   English

AG-Grid在IE11中具有vue错误挂接钩中出现错误:“ TypeError:无法获取未定义或空引用的属性'addEventListener'

[英]AG-Grid with vue error in IE11 Error in mounted hook: “TypeError: Unable to get property 'addEventListener' of undefined or null reference”

I am using the ag grid community edition with VUE CLI 我正在VUE CLI中使用ag网格社区版

Everytings working fine on chrome,firefox and safari but I am encountering an error in IE 11 chrome,firefox和safari上的所有功能都可以正常工作,但是我在IE 11中遇到错误

The error says: 错误提示:

[Vue warn]: Error in mounted hook: "TypeError: Unable to get property 'addEventListener' of undefined or null reference" [Vue警告]:挂接的钩子中出现错误:“ TypeError:无法获取未定义或空引用的属性'addEventListener'”

"Unable to get property 'addEventListener' of undefined or null reference" “无法获取未定义或空引用的属性'addEventListener'”

Here is my code in vue 这是我在Vue中的代码

<template>
<div>
    <button @click="getSelectedRows()">Get Selected Rows</button>

    <ag-grid-vue style="width: 500px; height: 500px;"
             class="ag-theme-balham"
             :columnDefs="columnDefs"
             :rowData="rowData">
    </ag-grid-vue>
    </div>
</template>
<style lang="scss" scoped>

</style>
<script>
import {AgGridVue} from 'ag-grid-vue'
export default {
    components:{
        AgGridVue
    },
    data(){
        return{
            columnDefs:null,
            rowData:null,
            gridApi: null,
            columnApi: null,
            autoGroupColumnDef: null,
        }
    },
    methods : {
        onGridReady : function(params){
            this.gridApi = params.api;
            this.columnApi = params.columnApi;


        },
        getSelectedRows : function(){
            const selectedNodes = this.gridApi.getSelectedNodes();
            const selectedData = selectedNodes.map(node => node.data);
            const selectedDataStringPresentation = selectedData.map(node => node.make + ' ' + node.model).join(', ');
            console.log(selectedDataStringPresentation);
        }
    },
    beforeMount(){
        this.columnDefs = [
                {headerName: 'Make', field: 'make'},
                {headerName: 'Model', field: 'model'},
                {headerName: 'Price', field: 'price'}
            ];

            this.rowData = [
                {make: 'Toyota', model: 'Celica', price: 35000},
                {make: 'Ford', model: 'Mondeo', price: 32000},
                {make: 'Porsche', model: 'Boxter', price: 72000}
            ];


    }
}
</script>

它估计必须在农业网格之前导入babel-polyfill polyfill。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IE11无法获取未定义或空引用的属性“值” - IE11 Unable to get property 'value' of undefined or null reference 在Win7上使用IE11的Javascript运行时错误:无法设置未定义或空引用的属性“禁用” - Javascript runtime error using IE11 on Win7: Unable to set property 'disabled' of undefined or null reference SCRIPT5007:无法在 IE11 中获取未定义或空引用的属性“值” - SCRIPT5007: Unable to get property 'value' of undefined or null reference in IE11 Angular2 IE11 无法获取未定义或空引用的属性“应用” - Angular2 IE11 Unable to get property 'apply' of undefined or null reference 无法获取未定义或空引用的属性“应用”-IE11和Chrome - Unable to get property 'apply' of undefined or null reference - IE11 and Chrome [Vue警告]:渲染错误:“ TypeError:无法获取未定义或空引用的属性&#39;Id&#39; - [Vue warn]: Error in render: "TypeError: Unable to get property 'Id' of undefined or null reference Angular 4错误TypeError:无法在IE中获取未定义或空引用的属性“应用” - Angular 4 ERROR TypeError: Unable to get property 'apply' of undefined or null reference in IE 在IE8中无法获取未定义或空引用错误的属性“刷新” - Unable to get property 'refresh' of undefined or null reference error in ie8 IE 9和10上的JS错误 - 无法获取1个未定义或空引用的属性 - JS error on IE 9 and 10 - Unable to get property of 1 undefined or null reference IE Javascript错误:无法获取未定义或空引用的属性“ 0” - IE Javascript Error: Unable to get property '0' of undefined or null reference
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM