@PlasterTom

Что такое local Dom в polymer?

Запутался в домах polymer: Shadow dom, shady dom, local dom, light dom...
Кто сталкивался, подскажите, что и как там работает.
  • Вопрос задан
  • 134 просмотра
Решения вопроса 1
@PlasterTom Автор вопроса
Из комментариев.
Here's an example to explain the difference. Suppose you have the following custom element:

<dom-module id="x-foo">

  <template>
    <div>I am local dom</div>
    <content></content>
  </template>

  <script>
    Polymer({
      is: 'x-foo'
    });
  </script>

</dom-module>

And you use it like this in your document:

<x-foo>I am light dom</x-foo>
What ever you put into the template of the element is local dom. What you put as children to your custom element when you use it is light dom. So, the local dom is determined by the creator the element, while the light dom is set by the user of the element. Of course, when you both create and use your own custom elements you have some flexibility what to put where.

И тут хорошая статья https://sohabr.net/habr/post/259187/?version=102597
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы