在vue-js-model中未定义$ model.show返回模型

问题描述

当我单击$ model.show('demo-login')按钮时,控制台中始终出现以下错误:

usersFollowSuccess: (state,action) => { const userId = action.payload._id; const filtered = state.data.filter((user) => { return user._id !== userId; }); return { ...state,data: [...filtered,action.payload].sort(sortFunc),// Here error: false,loaded: true,}; },

单击按钮即可获得完整输出:

TypeError: Cannot read property 'show' of undefined

我的代码:

product.vue

TypeError: Cannot read property 'show' of undefined
    at click (product.vue?1da5:1)
    at ie (vue.runtime.esm.js:1854)
    at HTMLButtonElement.i (vue.runtime.esm.js:2179)
    at HTMLButtonElement.Jr.a._wrapper (vue.runtime.esm.js:6917)
re @ vue.runtime.esm.js:1888
ne @ vue.runtime.esm.js:1879
ee @ vue.runtime.esm.js:1839
ie @ vue.runtime.esm.js:1862
i @ vue.runtime.esm.js:2179
Jr.a._wrapper @ vue.runtime.esm.js:6917

Main.js

<template>
    <div class="app">
        <demo-login-modal/>
        <button @click="$model.show('demo-login')">PP</button>
    </div>
</template>

<script>
import DemoLoginModal from '@/components/Modal_Login.vue';
export default {
  name: 'product',components: {
    DemoLoginModal,},};
</script>

Model_login副本中的弹出窗口

GitHub问题:https://github.com/euvl/vue-js-modal/issues/609

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)