最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - TypeError: Cannot read property 'v4' of undefined - Stack Overflow

programmeradmin2浏览0评论

I am getting this error in Vue.js:

vue.esm.js?efeb:628 [Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'v4'
of undefined"

found in

---> <AddTodo> at src/components/AddTodo.vue
   <App> at src/App.vue
     <Root>

I have already installed uuid, so v4 should be working, but it is not.

I am getting this error in Vue.js:

vue.esm.js?efeb:628 [Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'v4'
of undefined"

found in

---> <AddTodo> at src/components/AddTodo.vue
   <App> at src/App.vue
     <Root>

I have already installed uuid, so v4 should be working, but it is not.

Share Improve this question edited Sep 6, 2023 at 20:20 Peter Mortensen 31.6k22 gold badges110 silver badges133 bronze badges asked Aug 11, 2020 at 12:43 BonaventureBonaventure 711 silver badge7 bronze badges 0
Add a comment  | 

2 Answers 2

Reset to default 23

I got the same error and I solved it.

import {v4} from 'uuid';

const uuId = v4()

Use:

import * as uuid from 'uuid';

Now you can call anything from uuid. Such as,

uuid.v4();
发布评论

评论列表(0)

  1. 暂无评论