老字号餐厅将福寿螺当田螺卖 官方称已立案调查
时间:2024-09-11 09:24:02
如下所示:
<template> <section> <el-dialog :title="formTitle" :visible.sync="dialogFormVisible" :before-close="cancel"> <el-form :model="form" :rules="rules" ref="form"> </el-form> <div slot="footer" class="dialog-footer"> <el-button size="medium" type="primary" @click="addSubmit" :loading="addLoading" :disabled="unChange">確 定</el-button> </div> </el-dialog> </section> </template>
<script> export default { props: ["dialogFormVisible","form","formTitle"], data() { return { unChange: true, preForm: JSON.parse(JSON.stringify(this.form)) //深拷貝對象 }; }, watch: { form:{ handler:function(nowVal,oldVal){ var $this = this; for(let i in $this.form){ if(nowVal[i] != $this.preForm[i]) { $this.unChange = false; break; }else { $this.unChange = true; } } }, deep:true } }, methods: { addSubmit() { var $this = this; } }, mounted() { var $this = this; } }; </script>
以上這篇Vue2實時監(jiān)聽表單變化的示例講解就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
聲明:本網(wǎng)頁內容旨在傳播知識,若有侵權等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
本文如未解决您的问题请添加抖音号:51dongshi(抖音搜索懂视),直接咨询即可。