我正试图在流星1.0中使用bootstrap.我用这个命令在meteor中添加bootstrap包:"meteor add bootstrap".但它不能正确地对我有用.
我需要一行有两列.这是我的HTML:
<head>
<meta charset="utf-8">
<title>?????????? ????????</title>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-6">.col-md-6</div>
<div class="col-md-6">.col-md-6</div>
</div>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
但我看到两行宽度为100%.在容器或容器流体工作的地方,我看到这是一个屏幕.问题是什么?我需要在头文件中链接bootstrap.css?但Meteor自动这样做恕我直言.
谢谢.
我有以下Mongo DB文档结构:
{
_id: channelId,
title: channelTitle,
pubDate: channelPubdate,
items:
[
{
title: newsTitle,
desc: newsDescription,
link: newsLink,
pubDate: Date,
clicks: 0
},
{/*One more*/},
{/*...*/}
]
}
Run Code Online (Sandbox Code Playgroud)
我有麻烦增加Collection中的"clicks"字段(更新嵌入在数组中的文档的字段).
我在事件处理程序(客户端)中尝试了这个:
News.update({ _id : Session.get("channelId"), "items.link" : this.link },
{ $inc: { "items.clicks": 1 } }
);
Run Code Online (Sandbox Code Playgroud)
但它给出了一个错误: Uncaught Error: Not permitted. Untrusted code may only update documents by ID. [403]
然后我尝试通过服务器方法:
Meteor.methods({
incClicks: function(id, news)
{
News.update({ _id : id, "items.link" : news.link },
{ $inc : { "items.clicks": 1 …Run Code Online (Sandbox Code Playgroud)