為單個(gè)SVG路徑創(chuàng)建DOM元素的淘汰綁定處理程序。此綁定處理程序?qū)⒆詾閎mglsvgpath。
此綁定的參數(shù)是
- 路徑:SVG路徑作為字符串。
- 寬度:不應(yīng)用轉(zhuǎn)換的SVG路徑的寬度。
- 高度:不應(yīng)用轉(zhuǎn)換的SVG路徑的高度。
- css:可選。包含要應(yīng)用于SVG的其他CSS類的字符串。始終應(yīng)用bmgl svgpath svg。
Example
// Create an SVG as a child of a div
<div data-bind="bmglSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }"></div>
// parameters can be observable from the view model
<div data-bind="bmglSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }"></div>
// or the whole object can be observable from the view model
<div data-bind="bmglSvgPath: svgPathOptions"></div>