@lark-apaas/miaoda-presets 0.1.0-alpha.log.1 → 1.0.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.
@@ -1,11 +1,19 @@
1
1
  "use strict";
2
- // 加载性能监控脚本
3
- function getSlardarScript() {
2
+ /**
3
+ * 加载性能监控脚本
4
+ * @param {object} option
5
+ * @param {string} [option.bid='apaas_ai']
6
+ * @param {string} [option.globalName='KSlardarWeb']
7
+ * @returns
8
+ */
9
+ function getSlardarScript(option = {}) {
10
+ const bid = option.bid || 'apaas_ai';
11
+ const globalName = option.globalName || 'KSlardarWeb';
4
12
  return `
5
13
  <script>
6
14
  // 创建 Slardar 脚本元素
7
15
  const slardarScript = document.createElement('script');
8
- slardarScript.src = 'https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js?bid=apaas_ai&globalName=KSlardarWeb';
16
+ slardarScript.src = 'https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js?bid=${bid}&globalName=${globalName}';
9
17
  slardarScript.crossOrigin = 'anonymous';
10
18
 
11
19
  // 添加 onload 事件处理
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-presets",
3
- "version": "0.1.0-alpha.log.1",
3
+ "version": "1.0.1",
4
4
  "files": [
5
5
  "lib"
6
6
  ],