* 创建SVG图标元素 * @param {string} iconHref - 图标引用(如 '#play' 或 '#pause') * @returns {SVGElement} SVG元素
(iconHref)
| 314 | * @returns {SVGElement} SVG元素 |
| 315 | */ |
| 316 | function createSVGIcon(iconHref) { |
| 317 | const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); |
| 318 | svg.setAttribute('class', 'fa d-icon d-icon-rocket svg-icon prefix-icon svg-string'); |
| 319 | svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); |
| 320 | |
| 321 | const use = document.createElementNS('http://www.w3.org/2000/svg', 'use'); |
| 322 | use.setAttribute('href', iconHref); |
| 323 | |
| 324 | svg.appendChild(use); |
| 325 | |
| 326 | return svg; |
| 327 | } |
| 328 | |
| 329 | /** |
| 330 | * 创建控制开关按钮 |
no outgoing calls
no test coverage detected