简体   繁体   English

从数据库获取数据后,Summernote 中的表单数据不可见

[英]Form Data is not Visible in Summernote After Fetching Data from DB

I am using summernote editor.我正在使用 Summernote 编辑器。 I facing an error when going on edit page.进入编辑页面时遇到错误。

Form Field表单域

<div class="form-group col-12">
    <label>Service Content</label>
    <textarea name="content" id="summernote" class="form-control @error('content') is-invalid @enderror" rows="7" v-model="form.content">
    </textarea>

        @error('content')
            <span class="invalid-feedback">{{ $message }}</span>
        @enderror

</div>

Vue Vue

<script>
new Vue({
    el: '#vueApp',
    data() {
        return {
            form: {
                title: "{{ old('title', $page->title ?? '') }}",
                service_id: "{{ old('service_id', $page->service_id ?? '0') }}",
                keywords: "{!! old('keywords', $page->keywords ?? '') !!}",
                description: "{!! old('description', $page->description ?? '') !!}",
                content: "{!! old('content', $page->content ?? '') !!}",
                draft: "{{ old('draft', $page->draft ?? 'N') }}"
            },
            buttonText: "@if ($form !== 'add') Update @else Add @endif"
        };
    }
});
</script>

Error in Console控制台错误

Uncaught SyntaxError: Unexpected identifier (at edit:506:25) Uncaught SyntaxError: Unexpected identifier (at edit:506:25)

I am getting this error when I go on edit page.当我在编辑页面上出现 go 时出现此错误。

在此处输入图像描述

Where i am doing wrong, can anyone please guide?我在哪里做错了,有人可以指导吗?

Solved my Issue by adding this addslashes()通过添加此addslashes()解决了我的问题

content: "{!! old('content', addslashes($page->content) ?? '') !!}"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM