Home > Mobile >  Uncaught TypeError: _ctx.showEditModal is not a function in Vue 3 Laravel Poject
Uncaught TypeError: _ctx.showEditModal is not a function in Vue 3 Laravel Poject

Time:01-26

working with Laravel Vue Js 3 project. in My Tags.vue file I have edit button as well please see tags.vue file via this link https://codepen.io/amumodaya/pen/abjqXbV

but when I clicked edit button it is not appearance tag edit page and console encounted following error message Uncaught TypeError: _ctx.showEditModal is not a function onClick http://localhost:8000/js/app.js:20386

[Vue warn]: Unhandled error during execution of native event handler

app.js

import ViewUIPlus from 'view-ui-plus'
import 'view-ui-plus/dist/styles/viewuiplus.css'
import 'view-ui-plus/dist/styles/viewuiplus.css'
import common from './common'

createApp({
    components: {
        mainapp,
    }
    
}).use(router).use(ViewUIPlus).mixin(common).mount('#app');

how could I fix this problem?

CodePudding user response:

You're showEditModal is not inside the methods object:

export default {
    methods: {
        ...
    },
    showEditModal() { ... }
    created() {
        ...
    }
}

The same applies to showEditTag and showDeletingModal. You need to move those functions so they are part of the methods object, otherwise Vue won't treat them as methods.

  • Related