我正在学习使用 JavaScript 构建 Windows 8 应用程序开头的教程。我的 ListView 根本没有显示数据,我不知道该转向哪里。看起来很简单,但我一定错过了一些东西。当我运行应用程序(或在 Blend 中查看它)时,除了 ListView 数据之外,我看到了所有内容。知道我错过了什么吗?
这是结果:
这是 HTML:
<body>
<div class="fragment homepage">
<header aria-label="Header content" role="banner">
<button class="win-backbutton" aria-label="Back" disabled type="button"></button>
<h1 class="titlearea win-type-ellipsis">
<span class="pagetitle">Bob's RSS Reader</span>
</h1>
</header>
<section aria-label="Main content" role="main">
<div>List of feeds:</div>
<div data-win-control="WinJS.UI.ListView" data-win-options="{itemDataSource:feeds.dataSource}"></div>
</section>
</div>
</body>
这是 home.js 文件:
(function () {
"use strict";
window.feeds = [
{ title: "Brandon Satrom",
url: "http://feeds.feedburner.com/userinexperience/tYGT" },
{ title: "Chris Sells",
url: "http://sellsbrothers.com/posts/?format=rss" },
{ title: "Channel 9",
url: "http://channel9.msdn.com/Feeds/RSS" },
];
WinJS.UI.Pages.define("/pages/home/home.html", {
// This function is called whenever a user navigates to this page. It
// populates the page elements with the app's data.
ready: function (element, options) {
}
});
})();