From 616a07550106e427cea466562c42e540f3f4e23e Mon Sep 17 00:00:00 2001 From: Terran Date: Fri, 26 Jul 2019 00:04:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=A1=A8=E5=8D=95=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=9A=84id=E4=B8=AD=E6=9C=89=E2=80=9D-=E2=80=9C?= =?UTF-8?q?=E8=80=8C=E5=AF=BC=E8=87=B4=E7=9A=84js=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Editor.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Editor.php b/src/Editor.php index 4cbffc1..d134091 100644 --- a/src/Editor.php +++ b/src/Editor.php @@ -16,6 +16,8 @@ class Editor extends Field public function render() { $name = $this->formatName($this->column); + + $jsId = \Illuminate\Support\Str::studly($this->id); $config = Ueditor::config('config', []); @@ -28,9 +30,9 @@ public function render() window.UEDITOR_CONFIG.serverUrl = '{$laravel_ueditor_route}'; UE.delEditor("{$this->id}"); -var ue_{$this->id} = UE.getEditor('{$this->id}', {$config}); -ue_{$this->id}.ready(function() { - ue_{$this->id}.execCommand('serverparam', '_token', '$token'); +var ue_{$jsId} = UE.getEditor('{$this->id}', {$config}); +ue_{$jsId}.ready(function() { + ue_{$jsId}.execCommand('serverparam', '_token', '$token'); }); EOT;