「Vue.js入門」コンポーネントライブラリElementUIのdialogを閉じるサンプル

サンプルコード:
<!–dialog begin add–>
<el-dialog title=”ユーザ編集” :visible.sync=”dialogFormVisible”
custom-class=”editDialog”
:close-on-click-modal=”false”
:before-close = “cleanContent”
:show-close = “false”
size=’tiny’>
<el-form :model=”ruleForm” :rules=”rules” ref=”ruleForm”>
<el-form-item label=”ユーザ” prop=”account” label-width=”100px” >
<el-col :span=”20″>
<el-input v-model=”ruleForm.account” ></el-input>
</el-col>
</el-form-item>
</el-form>
<div slot=”footer” class=”dialog-footer”>
<el-button @click=”cancledialog(‘ruleForm’)”>キャンセル</el-button>
</div>
</el-dialog>

//js
cancledialog(formRule){
this.$refs[formRule].resetFields();
}

Comments are closed.