mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.0 KiB
2.0 KiB
Selector
Extends ModelWithPatches
Properties
nameString Selector name, eg.my-classlabelString Selector label, eg.My ClasstypeNumber? Type of the selector. 1 (class) | 2 (id)activeBoolean? If not active, it's not selectable by the Style Manager.privateBoolean? If true, it can't be seen by the Style Manager, but it will be rendered in the canvas and in export code.protectedBoolean? If true, it can't be removed from the attached component.
toString
Get selector as a string.
Examples
// Given such selector: { name: 'my-selector', type: 2 }
console.log(selector.toString());
// -> `#my-selector`
Returns String
getName
Get selector name.
Examples
// Given such selector: { name: 'my-selector', label: 'My selector' }
console.log(selector.getName());
// -> `my-selector`
Returns String
getLabel
Get selector label.
Examples
// Given such selector: { name: 'my-selector', label: 'My selector' }
console.log(selector.getLabel());
// -> `My selector`
Returns String
setLabel
Update selector label.
Parameters
labelString New label
Examples
// Given such selector: { name: 'my-selector', label: 'My selector' }
selector.setLabel('New Label')
console.log(selector.getLabel());
// -> `New Label`
getActive
Get selector active state.
Returns Boolean
setActive
Update selector active state.
Parameters
valueBoolean New active state