columnWidth
このヘルパー メソッドを実装した後、アプリがブラウザーをクラッシュさせます。私がやろうとしているのは、col-md-7
とcol-md-5
(Bootstrap クラス) の間を回転させて、2 つの連続する投稿が同じ幅にならないようにすることです。
columnWidth: function() {
if (Session.get('columnWidth') === 'col-md-7') {
Session.set('columnWidth', 'col-md-5');
} else {
Session.set('columnWidth', 'col-md-7');
}
return Session.get('columnWidth');
}
投稿テンプレート:
{{#each this}}
<div class="{{columnWidth}}">
<a href="/a/{{url}}"><img src="{{image}}" height="350" width="{{imageWidth}}" alt=""></a>
<div class="content">
<h2><a href="/a/{{url}}">{{title}}</a></h2>
<p>{{content}}</p>
<span class="dateAuthored">{{date}}</span>
</div>
</div>
{{/each}}
this
参照:
data: function() {
return Articles.find();
}
なぜこれが起こっているのですか?エラーは表示されません。ブラウザーのタブが応答しなくなります。ありがとう。