求改写JS, 能在控制台直接赋值json到items这个变量 5
<!DOCTYPEhtml><html><head><metacharset="utf-8"><metaname="viewport"content="width=dev...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>My App123</title>
<link rel="stylesheet" href="https://framework7.io/packages/core/css/framework7.bundle.min.css">
</head>
<body>
<div class="page-content">
<div class="list virtual-list media-list searchbar-found"></div>
</div>
<script type="text/javascript" src="https://framework7.io/packages/core/js/framework7.bundle.min.js"></script>
</script><script>
var app = new Framework7();
// Dummy items array
var items = [];
for (var i = 1; i <= items.rows; i++) {
items.push({
title: 'Item ' + i,
subtitle: 'Subtitle ' + i
});
}
var virtualList = app.virtualList.create({
// List Element
el: '.virtual-list',
// Pass array with items
items: items,
// List item Template7 template
itemTemplate:
'<li>' +
'<a href="#" class="item-link item-content">' +
'<div class="item-inner">' +
'<div class="item-title-row">' +
'<div class="item-title">{{title}}</div>' +
'</div>' +
'<div class="item-subtitle">{{subtitle}}</div>' +
'</div>' +
'</a>' +
'</li>',
// Item height
height: app.theme === 'ios' ? 63 : (app.theme === 'md' ? 73 : 46),
});</script>
</body>
</html>
=================
Framework7 的虚拟列表..., 想浏览器控制台本地测试换数据来着...
想要在控制台赋值这个items
var items = []; 展开
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>My App123</title>
<link rel="stylesheet" href="https://framework7.io/packages/core/css/framework7.bundle.min.css">
</head>
<body>
<div class="page-content">
<div class="list virtual-list media-list searchbar-found"></div>
</div>
<script type="text/javascript" src="https://framework7.io/packages/core/js/framework7.bundle.min.js"></script>
</script><script>
var app = new Framework7();
// Dummy items array
var items = [];
for (var i = 1; i <= items.rows; i++) {
items.push({
title: 'Item ' + i,
subtitle: 'Subtitle ' + i
});
}
var virtualList = app.virtualList.create({
// List Element
el: '.virtual-list',
// Pass array with items
items: items,
// List item Template7 template
itemTemplate:
'<li>' +
'<a href="#" class="item-link item-content">' +
'<div class="item-inner">' +
'<div class="item-title-row">' +
'<div class="item-title">{{title}}</div>' +
'</div>' +
'<div class="item-subtitle">{{subtitle}}</div>' +
'</div>' +
'</a>' +
'</li>',
// Item height
height: app.theme === 'ios' ? 63 : (app.theme === 'md' ? 73 : 46),
});</script>
</body>
</html>
=================
Framework7 的虚拟列表..., 想浏览器控制台本地测试换数据来着...
想要在控制台赋值这个items
var items = []; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询