如何使用 Semantic-UI CSS 框架附加垂直菜单进行分段?使用文档中提供的标记时,内容和菜单之间将有一个边距(由网格填充产生)。如果不使用网格,则边框不适合。
<div class="ui grid">
<div class="row">
<div class="sixteen wide column">
<!-- Overlapping border -->
<div class="ui horizontal segments">
<div class="ui vertical tabular menu">
<a class="active item">Bio</a>
<a class="item">Pics</a>
<a class="item">Companies</a>
<a class="item">Links</a>
</div>
<div class="ui segment">
This is an stretched grid column. This segment will always match the tab height
</div>
</div>
</div>
</div>
<div class="row">
<!-- Margin between the elements -->
<div class="four wide column">
<div class="ui vertical fluid tabular menu">
<a class="active item">Bio</a>
<a class="item">Pics</a> …Run Code Online (Sandbox Code Playgroud) 我试图用一些事件扩展简单的盒子小部件教程(http://docs.ckeditor.com/#!/guide/widget_sdk_tutorial_1),但我真的没有得到它.我的目标之一是在窗口小部件中的可编辑(例如,简单框标题)字段得到关注时触发事件.但不幸的是,我只能听取小部件本身的重点:
editor.widgets.add('simplebox', {
// definitions for
// button, template, etc
init: function() {
this.on('focus', function(ev){
console.log('focused this');
});
}
});
Run Code Online (Sandbox Code Playgroud)
或者如果数据发生了变化:
CKEDITOR.plugins.add('simplebox', {
// my plugin code
init: function (editor) {
editor.widgets.on( 'instanceCreated', function( evt ) {
var widget = evt.data;
widget.on('data', function(evt){
console.log("data changed");
});
});
}
//even more code
});
Run Code Online (Sandbox Code Playgroud)
如何在小部件中收听可编辑字段?对我来说,另一个挑战是在移除小部件时触发事件.也许有人也知道如何听这个事件?
如何检查深度嵌套对象是否包含值?我想检查给定的对象是否包含例如包含“where”的属性值:
let data = {
name: 'Somebody',
address: {
city: 'somewhere'
},
tags: [{
id: 5
name: 'new'
}]
}
check(data, 'where') // should be true
Run Code Online (Sandbox Code Playgroud)