zoukankan      html  css  js  c++  java
  • .sync修饰符

    :value.syc和this.$emit('update:value', val);一起

    v-model="showAlarm"和this.$emit('update:value', val);一组
    <history-alarm-dialog  v-if="showAlarm" :value.sync="showAlarm"></history-alarm-dialog> 
    
    <el-dialog v-dialog-drag :modal="false" :visible.sync="dialogVisible" title="历史事件" width="1200px">
    
    props: {
      value: Boolean
    },
    data: function(){
    },
    computed: {
    dialogVisible: {
            get: function() {
                return this.value;
             },
            set: function(val) {
                  this.$emit('update:value', val);
           }
    }
    },
    <history-alarm-dialog  v-if="showAlarm" v-model="showAlarm"></history-alarm-dialog>
    
    
    dialogVisible: {
             get: function() {
                        return this.value;
             },
             set: function(val) {
             this.$emit('input', val);
                     //this.$emit('update:value', val);
               }
     }
    v-model 在内部为不同的输入元素使用不同的属性并抛出不同的事件:
    
    text 和 textarea 元素使用 value 属性和 input 事件;
    checkbox 和 radio 使用 checked 属性和 change 事件;
    select 字段将 value 作为 prop 并将 change 作为事件。
  • 相关阅读:
    centos7上安装JupyterHub
    我的测试第一篇博客
    TCP,SYN,FIN扫描
    nmap使用帮助翻译
    MySQL 常用函数
    MySQL 视图
    MySQL 索引
    JAVA 注解
    JAVA 反射
    spring boot MySQL极简封装
  • 原文地址:https://www.cnblogs.com/liuguiqian/p/11328603.html
Copyright © 2011-2022 走看看