vue.js - 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,
},
},
解决方案
在 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
},
推荐阅读
- ruby-on-rails - 无法安装“Mysql2”版本 0.5.2
- c - 如何在 C 编程中移动文件?(移动文件())
- python - python:从其他文件获取变量的各种类型
- facebook-javascript-sdk - 如果用户未登录,则隐藏 Facebook 客户聊天插件
- sharepoint-online - 如何区分个人网站和 OneDrive 网站类型
- javascript - React - onChange 事件中的 setInterval
- javascript - 两次调用javascript排序函数的不同输出
- javascript - 如何在 ES6 中编写 javascript 函数
- reflection - Kotlin 反射返回不正确的类型
- java - BankAccount/SavingsAccount 程序提款方法不起作用