Fix: JSON экранирование в tags-input
✅ {!! json_encode() !!} вместо {{ json_encode() }} ✅ Правильный JavaScript формат Set Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -53,7 +53,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
const input = document.getElementById('{{ $name }}-input');
|
const input = document.getElementById('{{ $name }}-input');
|
||||||
const tagsContainer = document.getElementById('{{ $name }}-tags');
|
const tagsContainer = document.getElementById('{{ $name }}-tags');
|
||||||
const hiddenInput = document.getElementById('{{ $name }}');
|
const hiddenInput = document.getElementById('{{ $name }}');
|
||||||
let selectedTags = new Set({{ json_encode(array_map('strval', is_array($value) ? $value : [])) }});
|
let selectedTags = new Set({!! json_encode(array_map('strval', is_array($value) ? $value : [])) !!});
|
||||||
|
|
||||||
// Инициализация TomSelect
|
// Инициализация TomSelect
|
||||||
const select = new TomSelect(input, {
|
const select = new TomSelect(input, {
|
||||||
|
|||||||
Reference in New Issue
Block a user