この例のレンダリングされたライブHTMLがクリアされてから無限ループで再描画される理由を教えてください。この例のコードは、..私のラップトップ上のCPUをmaxesテンプレートは、元のデータに変更がなくても、再描画を続けます
環境:
- 流星0.3.7
- Mac OSのライオンのSafari 5.1.7でテスト
- 、クロムカナリア22.0.1189、クローム21.0.1180、Firefoxの11.0 & 13.0
初期プロジェクトの作成:
meteor create test
cd test
meteor add coffeescript
mv test.js test.coffee
meteor
test.coffee:
Records = new Meteor.Collection("records")
if Meteor.is_client
Template.table.records = ->
Records.find()
Template.table.rowCount = ->
Records.find().count()
if Meteor.is_server
Meteor.startup ->
if Records.find().count() is 0
for i in [1..1000]
Records.insert({some:"test", data: "just", to: "check"})
test.htmlという:
<head>
<title>test</title>
</head>
<body>
{{> table}}
</body>
<template name="table">
<table>
<caption>{{rowCount}}</caption>
{{#each records}}
<tr>
<td>{{some}}</td>
<td>{{data}}</td>
<td>{{to}}</td>
</tr>
{{/each}}
</table>
</template>
さまざまなデータセットサイズの同じサンプルコードを実行しました。サイズが800レコードを超えるセットでは、再描画に関する問題が発生しているようです。 – Lloyd
これをMeteor issue trackerに移動しました。 https://github.com/meteor/meteor/issues/207 – steveluscher
はい、私は気づいた、そのスティーブのおかげで – Lloyd