https://www.npmjs.com/package/idle-vue-3/v/1.0.1中提到的github存储库没有问题页面。所以,我想我得把它贴在这里。所提供的文件实际上并不是Vue 3。文档中使用的许多API已经过时。像import Vue from 'vue';,Vue.use等东西。WTF是项目所有者在做的!?!
下面的代码片段出现了错误:
app.use(IdleVue, {
eventEmitter: Vue,
//store,
store: Store,
idleTime: idleTimeInMillis,
startAtIdle: false
});Store是从另一个.js文件导入的:
export default async () => {
const Store = createStore({
modules: {
rules,
utils
},
// enable strict mode (adds overhead!)
// for dev mode only
state: {
clients: []
},
mutations: vuexfireMutations,
actions: {
bindClient: firestoreAction(async (context, ref) => {
return await context.bindFirestoreRef("clients", ref);
})
},
strict: process.env.DEV
});
return Store;
}浏览器控制台显示以下错误:
boot error: TypeError: r.registerModule is not a function这发生在在线app.use(IdleVue, {上。如有任何建议和见解,我们将不胜感激。
发布于 2022-02-03 05:48:27
什么叫过时?它计划被废弃,但还没有被废弃。
WTF是项目所有者在做的!?!
项目所有者做了他想做的事,为Vue创建了一个idle-js包装器。
Vue 3于2020年9月正式发布。
idle-vue早在2019年就已经存在了。
如果你检查一下回购,你就会发现它是叉子。
分叉回购是以idle-vue:https://www.npmjs.com/package/idle-vue的名字发布的。
idle-vue-2被接受但为空:https://www.npmjs.com/package/idle-vue-2
idle-vue-3是包含更多更改的分叉版本。
检查问题:https://github.com/soixantecircuits/idle-vue/issues/49,以了解您的问题。
只需自己使用idle-js,或者自己制作一个分叉,并支持Vue 3。
https://stackoverflow.com/questions/70954898
复制相似问题