小编Muh*_*man的帖子

BrowserRouter(从 react-router-dom 导入)和 ConnectedRouter(从 connected-react-router/immutable 导入)有什么区别?

import { ConnectedRouter } from 'connected-react-router/immutable';
import { BrowserRouter as Router,} from 'react-router-dom';
Run Code Online (Sandbox Code Playgroud)

我需要知道以上两者之间的区别。

reactjs react-router

6
推荐指数
2
解决办法
5798
查看次数

如何使用 Antd 在网页/浏览器中居中登录表单?

登录表格

<Row type="flex" justify="center" align="center">
    <Col span={4} >
      <form onSubmit={handleSubmit(this.handleSubmit)} >
        <Field
          style={{ marginBottom: 12 }}
          prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />}
          name="name"
          type="text"
          component={AInput}
        />
        <Field
          style={{ marginBottom: 12 }}
          className="form-group"
          prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />}
          name="password"
          type="password"
          component={AInput}
          />

          <Button

            block
            type="primary"
            htmlType="submit"
            className="login-form-button"
          >
            Log in
          </Button>
      </form>
    </Col>
  </Row>
Run Code Online (Sandbox Code Playgroud)

上面的登录表单需要在网页中居中,我尝试使用 antd 样式元素但失败了。它将使用 css 内联样式,但我不想这样。

reactjs antd ant-design-pro

5
推荐指数
2
解决办法
9881
查看次数

如何在不从 Nova 资源列表/索引中选择任何记录的情况下显示 Laravel Nova 操作?

在此输入图像描述

如下图所示。当我们从列表中选择记录时,会出现操作下拉菜单。但我需要始终显示它,无论用户是否选择某些记录。

laravel laravel-nova

4
推荐指数
1
解决办法
5967
查看次数

如何禁用 react-native-element 的复选框可触摸不透明度?

实际上,我正在使用 react-native-element 设计语言。当我过去实现复选框时,它的行为就像我不想要的可触摸不透明度。

<CheckBox
  containerStyle={{ backgroundColor: "transparent", borderWidth: 0 }}
  center
  size={14}
  title="vegetarian"
  textStyle={{
    fontSize: theme.FONT_SIZE_X_SMALL,
    fontWeight: theme.FONT_WEIGHT_LIGHT
  }}
  checkedColor="red"
  checked={this.state.checked}
  onPress={() => this.setState({ checked: !this.state.checked })}
/>;

Run Code Online (Sandbox Code Playgroud)

javascript react-native react-native-elements

3
推荐指数
1
解决办法
3052
查看次数

如何更改 Laravel-Nova 操作名称?

实际上,我需要更改 laravel nova 操作名称,例如翻译成不同的语言。

class PrintWithDetail extends Action
{
    use InteractsWithQueue, Queueable, SerializesModels;

    /**
     * Perform the action on the given models.
     *
     * @param  \Laravel\Nova\Fields\ActionFields  $fields
     * @param  \Illuminate\Support\Collection  $models
     * @return mixed
     */
    public function handle(ActionFields $fields, Collection $models)
    {
        $id = '';
        //
        foreach ($models as $model) {
            $id = $model->id;
        }
        return Action::openInNewTab(route("print.work.order", [$id, 'type' => 'detail']));
    }

}
Run Code Online (Sandbox Code Playgroud)

上面的操作将PrintWithDetail显示为名称。

但是,我需要将PrintWithDetail更改为荷兰语。

laravel laravel-nova

1
推荐指数
1
解决办法
1572
查看次数