Created
December 30, 2019 08:52
-
-
Save upangka/8e7ca458532dbbe2dac4d3612881572b to your computer and use it in GitHub Desktop.
vue elementui el-dialog .sync 理解
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<el-dialog | |
:title="data.title" | |
:width="width" | |
:visible.sync="data.visiable"> | |
<span>测试</span> | |
</el-dialog> | |
</div> | |
</template> | |
<script> | |
export default { | |
props: { | |
data: { | |
type: Object | |
} | |
}, | |
data () { | |
return { | |
width: '40%' | |
} | |
} | |
} | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ModifyData :data="modifyDialogData"></ModifyData> | |
data () { | |
return { | |
modifyDialogData: { | |
title: 'dialog', | |
visiable: true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
关闭弹窗,居然影响到了父组件,没有报如下错误:
原因时传递的是一个对象,而改变的值时存储在对象里面的。