Vue Project data functions should return an object

problem description

prompt error, data functions should return an object in vue project

clipboard.png

related codes

/ / Please paste the code text below (do not replace the code with pictures)

<template>
    <el-dialog title="Login" :visible.sync="dialogFormVisible" :modal="true" :modal-append-to-body="false" class="my-dialog">
        <el-form :model="form" label-width="100px" :rules="rules" ref="form">
            <el-form-item label="Username" prop="username">
                <el-input v-model="form.username" auto-complete="off" prefix-icon="iconfont icon-user"></el-input>
            </el-form-item>
            <el-form-item label="Password" prop="password">
                <el-input type="password" @keyup.enter.native="loginMethod" v-model="form.password" auto-complete="off" prefix-icon="iconfont icon-password"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible = false">Cancel</el-button>
            <el-button type="primary" @click.native="loginMethod">Log in</el-button>
        </div>
    </el-dialog>
</template>
export default {
  data() {
    return {
      dialogFormVisible: false,
      form: {
        username: "",
        password: ""
      },
      rules: {
        username: [
          {
            required: true,
            message: "please input your username",
            tigger: "blur"
          }
        ],
        password: [
          {
            required: true,
            message: "please input your password",
            tigger: "blur"
          }
        ]
      }
    };
  },
  methods: {
    loginMethod() {
      this.$refs.form.validate(valid => {
        if (valid) {
          this.$store
            .dispatch("LoginByUsername", this.form)
            .then(() => {
              Message.success("Login Success");
              this.$router.push({ path: "/" });
            })
            .catch(err => {
              Message.info(err);
            });
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    }
  }
};```

-sharp-sharp-sharp 
May.22,2021

is finally found because Message.info (err) is wrong. Message.info () is a component of element-ui and can only accept strings, not objects. It would be nice to change
to Message.info (err.message).


can be very strong, solving my same problem! I've been looking for it for a long time

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b39625-2aed1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b39625-2aed1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?