Fix: JSON экранирование в tags-input
✅ {!! json_encode() !!} вместо {{ json_encode() }} ✅ Правильный JavaScript формат Set Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
244dcdb5c9
commit
6a725d27de
|
|
@ -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, {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue