【发布时间】:2017-11-13 08:22:12
【问题描述】:
我创建一个 svg 并使用 SVG.js 添加一个路径,如下所示。
this.roomPlan = SVG('roomPlan').attr('id','roomPlanSvg').size(1024,
768);
this.roomPlan.path(room.area.d);
我有一个外部.scss 文件,我有一些样式如下;
.room-bg {
fill: nb-theme(card-bg);
stroke: transparent;
cursor: pointer;
stroke-width: 4px;
}
我想将.room-bg 选择器作为类添加到我的路径元素中,就像其他html 一样。
例如;
<path class="room-bg" />
注意:我正在开发 Angular2-Typescript 应用程序,并将 SVG.js 添加到项目中作为 npm 包。
感谢您的帮助。
【问题讨论】:
标签: javascript jquery css svg svg.js