Advertisement

visible.sync的作用

阅读量:

在前端开发中常见使用的(visible.sync)标记符通常用于同步操作。许多人对此并不完全了解。

在ElementUI框架中存在一个弹窗组件el-dialog时会调用:visible.sync属性。

复制代码
    <el-button type="text" @click="centerDialogVisible = true">点击打开 Dialog</el-button>
    
    <el-dialog
      title="提示"
      :visible.sync="centerDialogVisible"
      width="30%"
      center>
      <span>需要注意的是内容是默认不居中的</span>
      <span slot="footer" class="dialog-footer">
    <el-button @click="centerDialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
    
    <script>
      expor

全部评论 (0)

还没有任何评论哟~