提交 c72adfad 编写于 作者: Cano1997's avatar Cano1997

update: 表格注入属性脚本添加控制器参数

上级 e3362559
...@@ -287,7 +287,7 @@ export const GridControl = defineComponent({ ...@@ -287,7 +287,7 @@ export const GridControl = defineComponent({
) )
} }
scopedSlots={columnSlots} scopedSlots={columnSlots}
{...renderAttrs(this.c.model, { {...renderAttrs(this.c.model, this.c, {
context: this.context, context: this.context,
params: this.params, params: this.params,
data: this.c.getData() || [], data: this.c.getData() || [],
......
...@@ -258,6 +258,7 @@ export function useAppGridPagination(c: GridController) { ...@@ -258,6 +258,7 @@ export function useAppGridPagination(c: GridController) {
export function renderAttrs( export function renderAttrs(
model: GridColumnModel | GridModel, model: GridColumnModel | GridModel,
controller: GridController,
params: IParams, params: IParams,
): IParams { ): IParams {
const attrs: IParams = {}; const attrs: IParams = {};
...@@ -267,6 +268,7 @@ export function renderAttrs( ...@@ -267,6 +268,7 @@ export function renderAttrs(
if (item.attrName && item.attrValue) { if (item.attrName && item.attrValue) {
const args = { const args = {
...params, ...params,
controller,
}; };
const code = `return (function() { ${item.attrValue}} )();`; const code = `return (function() { ${item.attrValue}} )();`;
// eslint-disable-next-line no-new-func // eslint-disable-next-line no-new-func
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册