Javascript 定制荧光灯
我无法自定义默认荧光灯的样式。我尝试过使用以下文档中的代码:Javascript 定制荧光灯,javascript,jointjs,rappid,Javascript,Jointjs,Rappid,我无法自定义默认荧光灯的样式。我尝试过使用以下文档中的代码: this.paper.on('element:pointerdown', function(elementView) { elementView.highlight({ name: 'stroke', options: { padding: 10, rx: 5, ry: 5, attrs: { 'stroke-width': 13, s
this.paper.on('element:pointerdown', function(elementView) {
elementView.highlight({
name: 'stroke',
options: {
padding: 10,
rx: 5,
ry: 5,
attrs: {
'stroke-width': 13,
stroke: '#FF0000'
}
}
});
});
但它不会对默认的黄色3px荧光灯进行任何更改。以下内容对我适用:
this.paper.on('element:pointerdown', function(elementView) {
elementView.highlight(null /* defaults to cellView.el */, {
highlighter:{
name: 'stroke',
options: {
padding: 10,
rx: 5,
ry: 5,
attrs: {
'stroke-width': 13,
stroke: '#FF0000'
}
}
}
});
});
我通过简单地重写css类解决了我的问题
.joint-highlight-stroke.joint-theme-default {
stroke: #0157B9 !important;
stroke-width: 3px !important;
}