我已經遇到這種類型的代碼在我的HTML文件,在這裏,我只是想了解這是什麼data-bind
屬性和它的values
(例如:visible: tabs.active().value === 'sourceXml'
)。它在這裏做什麼?任何一個善意解釋。jquery html數據綁定屬性使用其
<div style="border: solid #ddd; border-width: 0 1px 1px 1px; padding: 16px 12px 8px 12px; margin-top: -20px">
<div data-bind="visible: tabs.active().value === 'sourceXml'">
<div data-bind="template: { name: 'sourceXml', data: sourceXml }"></div>
</div>
<div data-bind="visible: tabs.active().value === 'searchTerms'">
<div data-bind="template: { name: 'searchTerms', data: searchTerms }"></div>
</div>
<div data-bind="visible: tabs.active().value === 'outputFormat'">
<div data-bind="template: { name: 'outputFormat', data: outputFormat }"></div>
</div>
<div data-bind="visible: tabs.active().value === 'savedQueries'">
<div data-bind="template: { name: 'savedQueries', data: savedQueries }"></div>
</div>
</div>