问答 / 2 / 2 / 创建于 4年前
$grid->status()->switch();这里判断开关的值不能指定
$form->switch(‘status’) ->customFormat(function ($v) { return $v == ‘打开’ ? 1 : 0; }) ->saving(function ($v) { return $v ? ‘打开’ : ‘关闭’; });
地址:https://learnku.com/docs/dcat-admin/2.x/in-line-editing/8474#074355
而且目前我的状态是这么用的,
我要举报该,理由是:
$form->switch(‘status’)
->customFormat(function ($v) {
return $v == ‘打开’ ? 1 : 0;
})
->saving(function ($v) {
return $v ? ‘打开’ : ‘关闭’;
});
而且目前我的状态是这么用的,