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.
- package/package.json +1 -1
- package/src/converter.js +3 -3
package/package.json
CHANGED
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
|
-
|
|
212
|
+
export default {
|
|
213
213
|
${functions.map(func => ` ${func.name},`).join('\n')}
|
|
214
214
|
};
|
|
215
215
|
`;
|
|
216
216
|
|
|
217
217
|
// 检查是否已经有导出语句
|
|
218
|
-
if (!existingContent.includes('
|
|
218
|
+
if (!existingContent.includes('export default {')) {
|
|
219
219
|
fs.appendFileSync(outputPath, exportStatement, 'utf-8');
|
|
220
220
|
}
|
|
221
221
|
}
|