如何从插件更改 Grid.js 状态?

问题描述

如何从插件上下文更改 Grid.js 组件的状态?

我正在尝试为 stop 道具 (https://gridjs.io/docs/config/pagination) 实现可视化配置器

pagination.limit

它在网格的页脚下呈现类似 import { BaseComponent,BaseProps,h,PluginPosition } from 'gridjs'; class LimitConfigurator extends BaseComponent { setLimit(limitNew) { // this.setState({ pagination: {limit: limitNew}}); // this.config.pagination.limit = limitNew; } render() { const self = this; return h( 'div',{ class: 'limit-configurator' },[ h('span',{ onclick: function () { self.setLimit(10); } },'10'),h('span',{},'25'),'50'),] ); } } 内容,并为原始组件中的 10 | 25 | 50 路径动态设置新的每页编号。注册码:

pagination.limit

我在 // somewhere in the Vue component (using gridjs-vue bridge)... async mounted() { await elementReady('.grid-operator',{ stopOnDomready: false }); const gridComponent = this.$refs.gridReference.$data.grid; gridComponent.plugin.add( { id: 'limitEditor',component: LimitConfigurator,position: PluginPosition.Footer,},); gridComponent.forceRender(); }, 中看到 prop 值,但不知道如何从插件中正确操作它们(目前正在学习 preact + vue 环境)。有没有“方便”的方法来做到这一点?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)