Skip to content

Instantly share code, notes, and snippets.

module.exports = {
block: 'page',
title: 'Title of the page',
favicon: '/favicon.ico',
head: [
{ elem: 'meta', attrs: { name: 'description', content: '' }},
{ elem: 'css', url: 'index.min.css' }
],
scripts: [{ elem: 'js', url: 'index.min.js' }],
content: [

Method Title

Table of Contents

Description

Additional information about your API call.

  • URL

module.exports = {
block: 'page',
title: 'Title of the page',
favicon: '/favicon.ico',
head: [
{ elem: 'meta', attrs: { name: 'description', content: '' }},
{ elem: 'css', url: 'index.min.css' }
],
scripts: [{ elem: 'js', url: 'index.min.js' }],
content: [
// touch.blocks/Button/Button.js
import { decl } from 'bem-react-core';
export default decl({
block : 'Button',
willInit() {
this.state = {};
this.onPointerpress = this.onPointerpress.bind(this);
this.onPointerrelease = this.onPointerrelease.bind(this);

BEM for beginners. Why you need BEM

BEM is a hero in frontend world. It brings a system approach in you project and keeps it from the mess. ©

BEM makes your code scalable and reusable, thus increasing productivity and facilitating teamwork. Even if you are the only member of the team, BEM can be useful for you. Nevertheles many developers believe that such a systematic approach like BEM puts additional boundaries on their project and makes your project overloaded, cumbersome and slow.

Is BEM a Hero or a Villain? It's up to you! But first read the article.

BEMBatman

Подключаем BEM React Core ссылками с CDN

Документ описывает, как подключать предсобранные файлы библиотеки bem-react-core с CDN и как работать с библиотекой, не используя сборку.


Подключение библиотеки

Чтобы подключить библиотеку bem-react-core, создайде локально HTML-файл и скопируйте следующие ссылки в HTML-код страницы:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/prop-types/prop-types.min.js"></script>
<script src="https://unpkg.com/bem-react-core@1.0.0-rc.8/umd/react.js"></script>
</head>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/prop-types/prop-types.min.js"></script>
<script src="https://unpkg.com/bem-react-core@1.0.0-rc.8/umd/react.js"></script>
</head>
block('goods')(
tag()('ul'),
content()(function() {
return this.ctx.goods.map(function(item){
return [
{
elem: 'item',
content: [
.link
{
color: #666;
text-decoration: none;
}
.link__slogan
{
font: 11px Verdana, sans-serif;