In vue, use the this.$Modal console to prompt $attrs is readonly, using iview

go directly to the code

<script>
  import chat from "./../../store/modules/chat"
  export default {
    methods: {
      logout () {
        this.$Modal.confirm({
          title: "",
          loading: true,
          onOk: () => {
            let res = chat.logout()
            console.log(res)
            this.$Modal.remove()
            this.$router.push("/login")
          }
        })
      }
    }
  }
</script>
<template>
    <div class="m-menu">
        <Icon type="md-power" slot="prefix" class="exit" @click="logout"></Icon>
    </div>
</template>
The

function is normal, but there is an error

.
[Vue warn]: $attrs is readonly.
[Vue warn]: $listeners is readonly

Environment

"axios": "^0.18.0",
"iview": "^3.2.2",
"vue": "^2.6.6",
"vue-electron": "^1.0.6",
"vue-router": "^3.0.1",
"vuex": "^3.0.1",
"vuex-electron": "^1.0.0"

google searched for a long time and finally found a solution in element/issues.
https://github.com/ElemeFE/el...

modify webpack.render.config.js:

let whiteListedModules = ['vue'];

add iview ui

let whiteListedModules = ['vue', 'iview'];
There is no error protection for

, but it is still not possible to upgrade the vue version before.

Menu