【发布时间】:2019-08-10 07:44:22
【问题描述】:
我最近在查看 Google Firebase 的 quickstart-js/firestore/ 存储库中的代码时,在 index.html 中发现了以下 html:
63 <header id="site-header" class="mdc-toolbar mdc-toolbar--fixed">
64 <div id="title" class="mdc-toolbar__row mdc-layout-grid">
65 <section class="mdc-toolbar__section mdc-toolbar__section--align-start">
66 <span class="material-icons mdc-toolbar__icon--menu">restaurant</span>
67 <span class="mdc-toolbar__title">FriendlyEats</span>
68 </section>
69 </div>
70 <div id="section-header" data-fir-if="hasSectionHeader"></div>
71 </header>
72 </div>
然后在firestore/scripts/FriendlyEats.View.js/ 函数中的firestore/scripts/FriendlyEats.View.js/ 中引用此元素:
407 'data-fir-if': function(tel) {
408 var field = tel.getAttribute('data-fir-if');
409 if (!that.getDeepItem(data, field)) {
410 tel.style.display = 'none';
411 }
412 },
我的问题是:data-fir-if 标签是什么意思,这是某种命名约定吗?如果是这样,该命名约定是什么?我在哪里可以找到它的参考?
【问题讨论】:
-
至于约定,我认为this question 可以启发。欢迎使用 Stack Overflow。
标签: javascript html firebase google-cloud-firestore