xzx-icon-vue2 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xzx-icon-vue2",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "基于 Vue2 的内联 SVG 图标组件库",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -323,7 +323,7 @@
323
323
  <footer class="footer">
324
324
  <p>
325
325
  基于 <a href="https://www.npmjs.com/package/@xzx-design/icons-svg" target="_blank" rel="noopener">@xzx-design/icons-svg</a> 构建
326
- | 点击图标复制 Vue 代码
326
+ | 点击图标复制名称
327
327
  </p>
328
328
  </footer>
329
329
  </div>
@@ -339,7 +339,8 @@
339
339
 
340
340
  // 复制图标代码功能
341
341
  function copyIconCode(iconName, element) {
342
- const code = `<xzx-icon name="${iconName}" size="24"></xzx-icon>`
342
+ // 只复制图标名称,不包含标签
343
+ const code = iconName
343
344
 
344
345
  // 创建临时元素复制到剪贴板
345
346
  const textarea = document.createElement('textarea')
@@ -358,7 +359,7 @@
358
359
  setTimeout(() => {
359
360
  element.classList.remove('copied')
360
361
  tooltip.classList.remove('show')
361
- tooltip.textContent = '点击复制代码'
362
+ tooltip.textContent = '点击复制名称'
362
363
  }, 1500)
363
364
 
364
365
  // 更新统计
@@ -531,7 +532,7 @@
531
532
  <xzx-icon name="${iconName}" size="32"></xzx-icon>
532
533
  </div>
533
534
  <div class="icon-name">${iconName}</div>
534
- <div class="copy-tooltip">点击复制代码</div>
535
+ <div class="copy-tooltip">点击复制名称</div>
535
536
  </div>
536
537
  `).join('')
537
538
 
package/preview/server.js CHANGED
@@ -106,7 +106,7 @@ app.get('/simple', (req, res) => {
106
106
  : [...this.allIcons]
107
107
  },
108
108
  copy(name) {
109
- navigator.clipboard.writeText(\`<xzx-icon name="\${name}" size="24"></xzx-icon>\`)
109
+ navigator.clipboard.writeText(name)
110
110
  console.log('复制:', name)
111
111
  }
112
112
  }