【问题标题】:Laravel & Buefy - Get the old selected valueLaravel & Buefy - 获取旧的选定值
【发布时间】:2019-03-03 16:28:52
【问题描述】:

我正在使用 Laravel 5.8 和 Buefy...我正在尝试保留 <b-select>, 的旧值,但我的代码不起作用。

<b-field>
    <b-select name="nationality_id"
              placeholder="{{__('site.nationality')}}"
              icon="flag"
              icon-pack="fas"
              expanded>

        @foreach ($nationalities as $nationality)
            <option value="{{ $nationality->id }}" {{(old('nationality_id')==$nationality->id)? 'selected':''}}>
                {{ $nationality->name}}
            </option>
        @endforeach
    </b-select>
</b-field>

我知道我需要v-model,但我需要使用它的帮助。

【问题讨论】:

    标签: laravel buefy laravel-5.8


    【解决方案1】:

    你应该使用value prop,例如value="{{old('nationality_id')}}"

    【讨论】:

      猜你喜欢
      • 2018-06-05
      • 2023-03-19
      • 2018-11-21
      • 1970-01-01
      • 2015-05-22
      • 2021-06-02
      • 2018-02-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多