Skip to content

Commit 16d7a1e

Browse files
authored
Merge pull request #6 from xiaomlove/master
取编辑器内容改用id
2 parents be3110b + 925b651 commit 16d7a1e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

resources/views/editor.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<p>{!! old($column, $value) !!}</p>
1111
</div>
1212

13-
<input type="hidden" name="{{$name}}" value="{{ old($column, $value) }}" />
13+
<input id="input-{{$id}}" type="hidden" name="{{$name}}" value="{{ old($column, $value) }}" />
1414

1515
@include('admin::form.help-block')
1616

src/Editor.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Editor extends Field
1919
public function render()
2020
{
2121
$name = $this->formatName($this->column);
22+
$id = $this->formatName($this->id);
2223

2324
$config = (array) WangEditor::config('config');
2425

@@ -39,7 +40,7 @@ public function render()
3940
Object.assign(editor.customConfig, {$config})
4041
4142
editor.customConfig.onchange = function (html) {
42-
$('input[name=$name]').val(html);
43+
$('#input-$id').val(html);
4344
}
4445
editor.create()
4546

0 commit comments

Comments
 (0)