Comments (4)
В документации написано
Шаблон с подпредикатом на * будет приоритетнее, чем шаблон с конкретным именем в подпредикате.
https://github.com/bem/bem-xjst/blob/master/docs/ru/7-runtime.md#Шаблоны-на-любые-сущности
У нас есть бородатый баг про то, как себя ведет block('*')
и block('*').elem('*')
. Первый применится ко всему (и элементам без блоков и пустым объектам). А второй не применится ни к чему кроме пустых объектов. Это исправлено, но не выпущено, так как это мажорные изменения (хоть и исправление бага, но этим багом уже пользуются как есть). Могу добавить в этот PR твой пример в качестве тесткейса.
from bem-xjst.
Про шаблон с подпредикатом на * я знаю, в описании я имел ввиду #256 поэтому и написал или class1
или class2
что будет приоритетнее с этим багом я не знаю, а вопрос был почему он вообще выводит class3
если за block('*').elem('*').cls()('class1');
идет block('block').elem('*').cls()('class2');
а он не применяется?
block('block').elem('*').cls()('class2'); // Если пред. шаблон не применяется почему до этого не доходит очередь?
block('*').elem('*').cls()('class1'); // Если этот шаблон применяется почему тогда на выходе class3?
block('block').elem('elem').cls()('class3');
from bem-xjst.
@vill это баги.
-
Подпредикат
block('*').elem('*')
сейчас глючит и сам ни на что не матчится. -
Подпредикат
block('block').elem('*')
считает что ему необходимо найти элемент с именем*
и соответсвенно не применяется (не на что).
Я оба этих случая исправлю и добавлю тесткейсами в #455.
from bem-xjst.
Хорошо, понял.
from bem-xjst.
Related Issues (20)
- runtime-lint/index.js not found HOT 2
- Incorrect linter "someone changed ctx.mods" HOT 2
- Update bem-xjst in online demo
- Производительность движка в некоторых случаях можно увеличить HOT 5
- docs: Wrong default value for exportName in `3-api.md` HOT 2
- [online demo] Migrate from URL Shortener APIs to Firebase Dynamic Links (FDL) HOT 1
- bem-xjst 7.7.6-7.7.7. Увеличен размер бандла bemtree и bemhtml на клиенте
- Docs: insure all add* modes are present in docs
- attrescape: should escape `<` and `>` HOT 1
- Tree Shaking for templates (like CSSO for bem-xjst)
- attrescape: Do not escape & HOT 3
- Prevent multiple calls of add* methods on the same node
- Question about difference with 7.x behaviour
- Benchmarks: missing dependencies, broken link in documentation HOT 3
- Nested mixes are duplicated
- Nested mixes as BEMJSON are not processed HOT 1
- Nested mixes work wrong with strings HOT 1
- Не работает BEM-XJST Demo
- How to compile css style rules with component/block etc.?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bem-xjst.