Skip to content
This repository was archived by the owner on Feb 4, 2018. It is now read-only.

Commit 203855c

Browse files
author
blond
committed
docs(scope): add scope field
1 parent 2b87fbd commit 203855c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ API
6464
* [elem](#elem)
6565
* [mod](#mod)
6666
* [type](#type)
67+
* [scope](#scope)
6768
* [id](#id)
6869
* [isSimpleMod()](#issimplemod)
6970
* [isEqual(entityName)](#isequalentityname)
@@ -178,6 +179,24 @@ elemName.type; // elem
178179
modName.type; // elemMod
179180
```
180181

182+
### scope
183+
184+
The scope of this entity.
185+
186+
**Important:** block-typed entities has no scope.
187+
188+
```js
189+
const BemEntityName = require('@bem/entity-name');
190+
191+
const buttonName = new BemEntityName({ block: 'button' });
192+
const buttonTextName = new BemEntityName({ block: 'button', elem: 'text' });
193+
const buttonTextBoldName = new BemEntityName({ block: 'button', elem: 'text', mod: 'bold' });
194+
195+
buttonName.scope; // null
196+
buttonTextName.scope; // BemEntityName { block: 'button' }
197+
buttonTextBoldName.scope; // BemEntityName { block: 'button', elem: 'elem' }
198+
```
199+
181200
### id
182201

183202
The id for this entity.

0 commit comments

Comments
 (0)