關於element框架中rules中validator中undefined問題

問題 代碼 分析 其實在element-ui框架中,這裏rules中的checkPassword裏面的validator的this指向windows而不是Vue,而form指向Vue,所以獲取不到form,因此我們可以把validator後面代碼整合到Vue的地方,然後在Vue的地方this指向就是指向Vue,也就可以獲得this.form.renewpwd 解決
相關文章
相關標籤/搜索