美文网首页
Vue 的方法中调用另一个方法

Vue 的方法中调用另一个方法

作者: 陈怀哲 | 来源:发表于2018-11-12 11:34 被阅读13次

<script>
export default {
  name: "Login",
  data() {
    return {
      email: "",
      code: "",
      isSentCode: false,
    };
  },
  methods: {
    sendCodeBtnAction: function() {
    },
    nextBtnAction: function() {
      if (!this.isSentCode) {
        this.$options.methods.sendCodeBtnAction.bind(this)();
      //或者直接用这个
      //this..sendCodeBtnAction();
      } 
    }
  }
};
</script>

相关文章

网友评论

      本文标题:Vue 的方法中调用另一个方法

      本文链接:https://www.haomeiwen.com/subject/wvmqfqtx.html