关于线上js的调用 #6890
Unanswered
Creel-WH
asked this question in
Help/Questions
关于线上js的调用
#6890
Replies: 3 comments
-
请提供一个最小复现项目仓库,根据复现例子来解决问题。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
这有没有可能是一个作用域的问题?在 new 之前确保 cdn 调用成功,并确保 new 所处的作用域能访问前面 cdn 的中定义的class |
Beta Was this translation helpful? Give feedback.
0 replies
-
确实你应该包保证你的js包加载成功且正确的导出了JaLogger到全局。你可以尝试以下几个方案测试
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
我自己写了一个js文件,里面有一个class类,然后发到了oss上,之后在我的vue项目中通过cdn的方式调用,为什么都显示我的这个class对象不存在呢
class JaLogger { constructor(e) { this.params = { systemType: getOS(), accessTime: getNowTime(), network: navigator.connection.effectiveType, sr: window.screen.width + '*' + window.screen.height, domain: document.domain, userName: '鏈櫥褰�', userId: 0, jobNumber: '', deptName: '', deptId: 0, mobile: 0, } Object.assign(this.params, e) } }
在vue项目中,我新建了一个js文件,执行以下代码
const _ul = new JaLogger({...})
一直显示JaLogger未定义
是哪个js出了问题呢
Beta Was this translation helpful? Give feedback.
All reactions