-
Notifications
You must be signed in to change notification settings - Fork 150
Closed
Milestone
Description
Demo如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script src="http://rawgit.com/sindresorhus/multiline/master/browser.js"></script>
<script src="http://rawgit.com/regularjs/regular/master/dist/regular.min.js"></script>
<script>
var ListView = Regular.extend({
name: 'listView',
config: function() {
var self = this;
setTimeout(function() {
self.$update('list1', []);
self.$update('list2', [{name: 1}]);
}, 200);
},
template: multiline(function(){/*
{#list list as item}
<div>{item.name}</div>
{/list}
*/})
});
var App = Regular.extend({
config: function() {
// this.data.children1 = undefined;
// this.data.children2 = undefined;
},
template: multiline(function(){/*
<listView list1={children1} list2={children2} />
{#if children1}Length: {children1.length}{/if}
{#if children2}Length: {children2.length}{/if}
*/})
});
(new App()).$inject('body');
</script>
</body>
</html>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels