GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

can't set property's name #1948

Closed java858 closed 5 years ago

java858 commented 5 years ago

https://github.com/artf/grapesjs/issues/1398#issuecomment-417954677 why i can't set any property ? i try to update dog's name into 'cat', but i can't make it. but followed your example code. both set({ name: 'cat' }) and set('name', 'cat'). the only reason i have to update properties' name is because i want to change them into chinese. i read many issues about non-english language support, and you said set property new name is the only way. but it doesn't work. thanks

const editor = grapesjs.init({ container: '#gjs', components: '<div class="txt-red">Hello world!</div>', style: '.txt-red{color: red}', }); const styleManager = editor.StyleManager; var sector = styleManager.addSector('mySector', { name: 'My sector', open: true, properties: [{ name: 'dog' }] }); var property = styleManager.getProperty('mySector', 'dog').set('name', 'cat') console.log(property) 1554714193(1) 1554714230(1) 1554714250(1)

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.