Skip to content

Commit

Permalink
added textarea vue v-model or @input method. (#n39bu5)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jun 28, 2021
1 parent 85fd9ff commit cee54e9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion resources/views/partials/form/textarea_group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ class="form-group {{ $col }}{{ isset($attributes['required']) ? ' required' : ''
{!! Form::label($name, $text, ['class' => 'form-control-label'])!!}
@endif

@php
$vue_key = '@input';
if (!empty($attributes['enable-v-model'])) {
$vue_key = 'v-model';
}
@endphp

{!! Form::textarea($name, $value, array_merge([
'class' => 'form-control',
'data-name' => $name,
'placeholder' => trans('general.form.enter', ['field' => $text]),
'@input' => !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event.target.value' : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name . ' = $event.target.value' : 'form.' . $name . ' = $event.target.value'),
$vue_key => !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name),
], $attributes)) !!}

<div class="invalid-feedback d-block"
Expand Down

0 comments on commit cee54e9

Please sign in to comment.