1

我正在尝试为我的一个具有JSONB数据类型的模型显示和启用编辑。

导师模型

const Instructor = sequelize.define('Instructor', {
    id: {
        type: Sequelize.INTEGER,
        autoIncrement: true,
        primaryKey: true
    },
    submission: {
        type: DataTypes.JSONB,
        allowNull: false
    },
}, {});

资源定义

const adminBro = new AdminBro({
    resources: [{resource: Provider}, {
        resource: Instructor,
        options: {
            properties: {
                submission: {
                    type: 'mixed',
                    show: true,
                    filter: false,
                    edit: true
                },
            },
        }
    }],
})

const router = AdminBroExpress.buildRouter(adminBro)

app.use(adminBro.options.rootPath, router)

这是管理员中的 UI 结果: 在此处输入图像描述

4

0 回答 0