zoukankan      html  css  js  c++  java
  • vue 取到v-decorator的值,并使用v-if渲染表单其他组件

    <a-form :form="form">
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="商品类型">
        <j-dict-select-tag v-decorator="['type', validatorRules.type]" placeholder="请选择商品类型" dictCode="product_type"
                           :trigger-change="true" @change="getType"/>
    <a-row style="margin:0px 0px 20px 0px" v-if="productType == 'pro'">
      <a-col :span="16" :offset="5">
        <a-button type="primary" @click="showProductModal">
          选择商品
        </a-button>
        <!-- 商品分页选择表单区域 -->
        <product-type-modal ref="modalForm" @ok="modalFormOk" :app-id="appId"></product-type-modal>
      </a-col>
    </a-row>
    <a-row style="margin:0px 0px 20px 0px" v-else-if="productType != ''&& productType!='pro' && productType != undefined">
      <a-col :span="16" :offset="5">
        <a-button type="primary" @click="showServiceModal">
          选择业务包
        </a-button>
        <!-- 业务包分页选择表单区域 -->
        <service-type-modal ref="modalServiceForm" @ok="modalServiceFormOk"></service-type-modal>
      </a-col>
    </a-row>
    在方法里,
    
    //当切换商品类型的时候,得到他的值
    getType() {
        this.$nextTick(() => {
            console.log('form:{}', this.form.getFieldValue('type'));
            this.productType = this.form.getFieldValue('type')
        });
    },
    
  • 相关阅读:
    List<T> 添加 DataTable
    sql 在not in 子查询有null值情况下经常出现的陷阱
    SQL查询~ 存在一个表而不在另一个表中的数据
    SQL Server xtype
    jQurey 获取当前时间
    sp_rename
    Longest Substring Without Repeating Characters
    Fraction to Recurring Decimal
    链表翻转系列
    蓄水池抽样
  • 原文地址:https://www.cnblogs.com/xiadongqing/p/15484952.html
Copyright © 2011-2022 走看看