const script = document.createElement('script')
script.src = '本地js路径.js'
document.head.appendChild(script)
app的vue页面通过这种方式引用本地js插件,用H5浏览、或者真机调试时运行正常,但是打包成安卓包,安装到手机上后,引入的js无效,导致页面无法展示,有什么其他方法么?
用import 引入的话插件会报错:
Module parse failed:Unexpected token(64 : 194745)
File was processed with these loaders:
./node_modules/babel-loader/lib/index.js
./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js
You may need an additional loader to handle the result of these loaders.
| * licensed under the bsd-3-clause license
1 个回复
l***@3975.com
app端不支持使用document操作节点