cuxml 2.1.0 → 2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/converter.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cuxml",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "A tool to help use ribbon UI for your WPS Office Client JS add-in project.",
5
5
  "keywords": [
6
6
  "wps office",
package/src/converter.js CHANGED
@@ -206,16 +206,16 @@ class XMLConverter {
206
206
  }
207
207
  });
208
208
 
209
- // 添加导出语句
209
+ // 添加导出语句(浏览器端使用 export default)
210
210
  const exportStatement = `
211
211
  // 导出所有回调函数(如果不需要导出,可以注释掉以下语句)
212
- module.exports = {
212
+ export default {
213
213
  ${functions.map(func => ` ${func.name},`).join('\n')}
214
214
  };
215
215
  `;
216
216
 
217
217
  // 检查是否已经有导出语句
218
- if (!existingContent.includes('module.exports = {')) {
218
+ if (!existingContent.includes('export default {')) {
219
219
  fs.appendFileSync(outputPath, exportStatement, 'utf-8');
220
220
  }
221
221
  }