#javascript #html #jquery #grapesjs
#javascript #HTML #jquery #grapesjs
Вопрос:
Я использую grapes.js
редактор, и я хотел бы в одном столбце вставить StyleManager
и диспетчер черт. Как это возможно?
Мой код:
styleManager: {
traitsManager: {},
sectors: [{
open: true,
buildProps: ['text-align', 'width', 'height', 'max-width', 'min-height', 'margin', 'font-family', 'font-size', 'font-weight',
'letter-spacing', 'color', 'line-height', 'text-decoration', 'font-style','background-color','background'],
property: 'text-align',
defaults: 'left',
properties: [{
property: 'text-align',
list: [
{ value: 'left'},
{ value: 'center'},
{ value: 'right'}
]
}]
}],
}
Ответ №1:
Да, можно это сделать.
HTML
<div>
<div id="selectors-container" />
<div id="style-manager-container" />
<div id="traits-container" />
</div>
JS
styleManager: {
appendTo: document.querySelector('#style-manager-container'),
},
selectorManager: {
appendTo: document.querySelector('#selectors-container'),
},
traitManager: {
appendTo: document.querySelector('#traits-container'),
},