bem / bem-xjst

bem-xjst (eXtensible JavaScript Templates): declarative template engine for the browser and server
https://bem.github.io/bem-xjst
Other
116 stars 48 forks source link

Matching for "block mod + elem" not work #343

Closed 4ok closed 8 years ago

4ok commented 8 years ago

block('block-name').mod('mod-name', 'mod-val').elem('elem-name')

This construction not work

miripiruni commented 8 years ago
  1. bem-xjst version?
  2. Can you provide example with template, bemjson and result? You can use online demo for sharing code snippet: https://bem.github.io/bem-xjst
miripiruni commented 8 years ago

@4ok https://github.com/bem/bem-xjst/blob/master/CHANGELOG.md#2016-01-29-v500-miripiruni It’s not about this?

miripiruni commented 8 years ago

@4ok ping

miripiruni commented 8 years ago

Feel free to reopen if it’s not clear.

4ok commented 8 years ago

@miripiruni not it is

4ok commented 8 years ago

I'm sorry for the delay


Bem-xjst version: 7.0.4

This construction is not work if elem is inside of the another block, for example it is inside of 'block-name-inside'


Bemjson:

{
    block : 'block-name',
    mods : {
        'mod-name' : 'mod-val'
    },
    content : [
        {
            block : 'block-name-inside',
            content : [
                {
                    block : 'block-name',
                    elem : 'elem-name',
                }
            ]
        }
    ]
}

Bemhtml:

block('block-name').mod('mod-name', 'mod-val').elem('elem-name')(
    content()('THIS CONSTRUCTION IS NOT WORK')
)

Example

4ok commented 8 years ago

Sorry I understand. it was necessary to add mix to child block. This work example.