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')
        });
    },
    
  • 相关阅读:
    [牛客]十二桥问题 解题报告
    [NOIP2017 逛公园] 解题报告
    [JSOI2008]最小生成树计数 解题报告
    类欧几里得算法
    概率与期望题目列表
    [SCOI2008]配对 解题报告
    拦截导弹
    牛客网-约数的个数
    牛客网-成绩排名
    最大连续区间和的算法总结
  • 原文地址:https://www.cnblogs.com/xiadongqing/p/15484952.html
Copyright © 2011-2022 走看看