关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、3102411850 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 7033|回复: 0

JDictSelectTag 组件错位问题修正

[复制链接]
发表于 2019-12-12 11:17:08 | 显示全部楼层 |阅读模式
JDictSelectTag 字典组件增加getPopupContainer参数,用于解决使用 `a-modal` 或其他带有滚动条的组件时,产生的错位问题。

1、JDictSelectTag props增加getPopupContainer
export default {
    name: "JDictSelectTag",
    props: {
      dictCode: String,
      placeholder: String,
      triggerChange: Boolean,
      getPopupContainer: {
        type: Function,
        default:() => document.body
      },
      disabled: Boolean,
      value: String,
      type: String
    },



2、a-select 标签设置getPopupContainer
<a-select :getPopupContainer="getPopupContainer" v-else-if="tagType=='select'" :placeholder="placeholder" :disabled="disabled" :value="value" @change="handleInput">
    <!-- <a-select-option value="">请选择</a-select-option> -->
    <a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value">
      <span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
        {{ item.text || item.label }}
      </span>
    </a-select-option>
  </a-select>

3、组件使用,传入getPopupContainer
  <j-dict-select-tag v-decorator="['companyType', validatorRules.companyType]"
                             :triggerChange="true"
                             placeholder="请输入企业类型" :getPopupContainer="node => node.parentNode"
                             dictCode="company_type" />

4、如果有其他更好的方式或者此问题已解决,请指正。

谢谢
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表