我正在处理干净的 Windows 10 安装。唯一的事情是我安装了 cygwin 以在 cmd 中获取 unix 命令。
当我输入时,npm install -g @angular/cli它会下载必要的文件,但我收到一个错误:
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket.<anonymous> (_tls_wrap.js:1092:38)
gyp ERR! stack at emitNone (events.js:86:13)
gyp ERR! stack at TLSSocket.emit (events.js:185:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:610:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\@angular\\cli\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" …Run Code Online (Sandbox Code Playgroud) 我正在为 MacOS 编写一个应用程序,主要功能是将数据同步到 iCloud。我已经完成的所有工作就是 - 打开 Core-Data 和 CloudKit 选项的项目, - 创建一个模型和一些基本例程,通过将文件导入到应用程序来创建模型。
由于这是一个大文件,因此我在单独的线程/调度新队列中执行所有操作。当我调试应用程序时,将数据保存到本地数据库工作正常,然后当应用程序失去焦点时数据会同步到云,我不得不说它有效,我可以通过查询 CloudKit 仪表板中的数据来说明这一点。但是,当我开始导入文件以及在导入过程中我将切换到其他应用程序时,同步数据存在问题。导入完成后,我看到数据存储在本地,但无法同步到云端。相反,我在控制台中看到以下错误:
CoreData: 调试: CoreData+CloudKit: -PFCloudKitThrottledNotificationObserver noteRecievedNotification:: : 得到: NSApplicationWillBecomeActiveNotification - 0 CoreData: 调试: CoreData+CloudKit: -PFCloudKitThrottledNotificationObserver noteRecievedNotification:: : 得到: NSApplicationDidBecomeActiveNotification - 1 CoreData: CloudKit: CoreData+CloudKit: -PFCloudKitThrottledNotificationOb服务器注释已收到通知: : - 已经安排了一个块来响应“NSApplicationDidBecomeActiveNotification”,此后有 2 个通知。CoreData: debug: CoreData+CloudKit: -[PFCloudKitThrottledNotificationObserver noteRecievedNotification:]_block_invoke(49): : 为“NSApplicationWillBecomeActiveNotification”执行“AppActivateObserver”块,清除 2 次迭代。CoreData: CloudKit: CoreData+CloudKit: -NSCloudKitMirroringDelegate _scheduleAutomatedExportWithLabel:activity:completionHandler:: - 开始自动导出 - AppActivationExport: (null) CoreData: CloudKit: CoreData+CloudKit: -NSCloudKitMirroringDelegateexecuteMirroringRequest:error:: : 要求执行请求:41AA55D5- F8A9-4EA9-A12A-9CA05775EC03 CoreData: CloudKit: CoreData+CloudKit: -NSCloudKitMirroringDelegate _scheduleAutomatedImportWithLabel:activity:completionHandler:: - 开始自动导入 - AppActivationImport - 响应活动:(null) CoreData: …
我只是在鼠标移动时滚动div内容有点麻烦.所以没有显示滚动条等.
所以我有17个项目.每件商品均为50x50像素.面膜是300x50.所以,我的面具是overflow: hidden和itemsWrapper拥有所有子项的宽度.我想在mousemove事件上水平滚动项目.enyone能给我一些建议吗?
现在我有以下代码:
$(document).ready(function() {
$('#navMask').on('mousemove', function(e) {
var leftOffset = $(this).offset().left;
$('#itemsWrapper').css('left', -e.clientX + leftOffset);
console.log($(this).outerWidth() + ' - ' + $(this)[0].scrollWidth);
});
});Run Code Online (Sandbox Code Playgroud)
#navMask {
position: relative;
overflow: hidden;
background: #ccc;
margin: 0 5px;
width: 300px;
height: 50px;
}
#tabWrapper {
position: absolute;
margin-left: 0;
}
.tab {
width: 50px;
height: 50px;
float: left;
background: beige;
}
.tab:hover {
background: #e4e4a1;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div id='navMask'>
<div id='itemsWrapper'>
<div class='item'>1</div>
<div class='item'>2</div>
<div …Run Code Online (Sandbox Code Playgroud)嗨,我找不到任何类似的问题,所以我发布了新问题。在下面的代码中,我创建带有ListBoxItems的ListBox控件,每个控件内部都包含单选按钮。当我单击单选按钮时,它会被选中,但父级ListBoxItem不会被选中(ListBoxItem未突出显示)。我该如何解决这个问题?
<ListBox Margin="0, 5, 0, 0" ItemsSource="{Binding mySource, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" SelectionMode="Single">
<ListBox.ItemTemplate>
<DataTemplate>
<!-- Rabio template -->
<RadioButton GroupName="radiosGroup"
Margin="10, 2, 5, 2"
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.SelectedSetting}"
CommandParameter="{Binding SomeId, Mode=OneWay}"
Content="{Binding FileNameWithoutExtensions, Mode=OneWay}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Run Code Online (Sandbox Code Playgroud) 我有一个对象,我想在其中编写一个自执行函数.我有这样的事情:
var testObject= (function () {
function testObject() {
this.counter = 0;
}
testObject.prototype.Cycle = function () {
try {
console.log("tick, ID: " + this.counter++);
setTimeout(this.Cycle, 2000);
} catch (ex) {
console.log(ex);
}
};
return testObject;
})();
Run Code Online (Sandbox Code Playgroud)
它只工作一次.因为它在第一次运行时给出,tick, ID: 0并且在第二次运行时给出tick, ID: undefined.实现自执行功能的最佳方法是什么?