首页 > 解决方案 > Send props to frameworkComponents (ag-grid) with Vue

问题描述

I would like to pass a props to frameworkComponents, I am using Vue. Any idea how I could do it?

file grid.vue

<ag-grid-vue
      class="ag-theme-balham"
      :gridOptions="gridOptions"
      :rowData="rowData"
      :frameworkComponents="this.frameworkComponents"
      :myprops="this.data"
 ></ag-grid-vue>

file myFrameworkComponent.vue

props: {
    myprops: {
        type: String,
    },
},

标签: vue.jsag-grid

解决方案


在 grid.vue 中,我只是在 columnDef 中定义了参数。

{
    field: 'helloId',
    headerName: 'Hello',
    filter: "dropdown",
    filterParams: 'this is my message or object',
},

在 myFrameworkComponent.vue 的挂载中调用此参数后:

mounted: function() {
    myprops: this.params.colDef.filterParams
},

推荐阅读