在app.vue引用push-uniapp.js 报了很奇怪的问题,
15:25:36.109 [Vue warn]: Error in event handler for "api.onSocketTaskStateChange": "TypeError: Cannot read property 'indexOf' of undefined"
(found <Root>)
15:25:36.109 TypeError: Cannot read property 'indexOf' of undefined
app.vue文件
<script>
import push from '@/util/push-uniapp.js';
export default {
onLaunch: function() {
var connection = new push({
url: 'ws://127.0.0.1:3131', // websocket地址
app_key: 'ba081ad813660c0c4b34a040baa6ad5b',
auth: 'https://127.0.0.1:3131/plugin/webman/push/auth' // 订阅鉴权(仅限于私有频道)
});
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
</style>
这个是我本地环境
正在学习中~也不知道是引用的问题还是其他问题,请大佬指点下~