weixin_41939424 2019-09-02 18:35 采纳率: 0%
浏览 1447

vue中使用iview,在table表格中使用render()函数返回的下拉框被挡住了。求助前端大神。

# ## #vue中使用iview,在table表格中使用render()函数返回的下拉框被挡住了。 网上百度的给下拉框加z-index和设置position:absolute都不好使,求助前端大神。

<template>
  <!--添加数据 - 单次引入-->
  <div>
    <!--在这里指定目标列和tagging列 表单-->
    <div style="width: 90%; margin-left: 50px; margin-top: 10px; background-color: white;overflow: hidden;">
      <Form :model="formItem" ref="formValidate" :rules="ruleValidate" :label-width="200" style="width: 70%;margin-top: 30px;">
        <FormItem label="命名空间" prop="nameSpace">
          <Select v-model="formItem.nameSpace" placeholder="输入命名空间,支持英文字母、数字、下划线和加减号">
            <Option v-for="(item, index) in formItem.nameSpace" :key="index" :value="item.value">
              <span>{{item.name}}</span>
            </Option>
          </Select>
        </FormItem>
        <FormItem label="导入数据组" prop="dataGroup">
          <RadioGroup v-model="formItem.dataGroup">
            <Radio label="not">不导入数据组</Radio>
            <Radio label="female">导入已有数据组</Radio>
            <Radio label="male">创建新数据组</Radio>
          </RadioGroup>
        </FormItem>
        <FormItem label="数据表名" prop="dataTableName">
          <Input v-model="formItem.dataTableName" placeholder="输入数据表名,支持英文字母、数字、下划线和加减号"></Input>
        </FormItem>
        <FormItem label="类型异常行" prop="excepRow">
          <RadioGroup v-model="formItem.excepRow">
            <Radio label="not">设置为null</Radio>
            <Radio label="female">抛掉异常行</Radio>
            <Radio label="male">放弃本次引入</Radio>
          </RadioGroup>
        </FormItem>
        <FormItem label="与标准列数不一致" prop="excepCol">
          <RadioGroup v-model="formItem.excepCol">
            <Radio label="female">抛掉异常行</Radio>
            <Radio label="male">放弃本次引入</Radio>
          </RadioGroup>
        </FormItem>
        <FormItem label="高级参数" prop="seniorParam">
          <RadioGroup v-model="formItem.seniorParam">
            <Radio label="not">使用默认配置</Radio>
            <Radio label="female">自定义高级参数</Radio>
          </RadioGroup>
        </FormItem>
      </Form>
    </div>

    <!--编辑字段名、类型表格-->
    <div style="width: 90%; margin: 10px 0 0 50px; background-color: white;overflow: hidden;" align="center">
      <Row style="width: 90%;">
        <Col span="10">
          <h2 align="left" style="margin: 20px 0 20px 0;">编辑字段</h2>
        </Col>
        <Col span="14">
          <h2 align="right" style="margin: 20px 0 20px 0;">点击字段名或字段类型进入批量编辑模式</h2>
        </Col>
      </Row>
      <div style="width: 90%;">
        <Table :columns="dataPreviewColumns" :data="dataPreviewData"></Table>
        <!--分页-->
        <div style="margin: 10px;overflow: hidden">
          <div style="float: left;">
            <Page :total="dataPreviewData.length" :current="1" prev-text="上一页" next-text="下一页" show-total show-sizer show-elevator></Page>
          </div>
        </div>
      </div>
      <Button @click="importData" type="primary" size="large" style="float: right;margin: 0 100px 30px 0;width: 150px;">下一步</Button>
    </div>
  </div>

</template>

<script>
  /* eslint-disable */
  export default {
    name: 'once-import-next',
    data () {
      return {
        columnName: ['String', 'SmallInt', 'Int', 'BigInt', 'Float', 'Double', 'Date', 'TimeStamp'],
        formItem: { // 表单项集合
          nameSpace: [{name:'data_test', value:'data_test'}],
          dataGroup: '',
          dataTableName: '',
          excepRow: '',
          excepCol: '',
          seniorParam: ''
        },
        ruleValidate: { // 表单字段校验规则
          nameSpace: [
            { required: true, message: '请选择命名空间', trigger: 'change' }
          ],
          dataGroup: [
            { required: true, message: '请选择数据组', trigger: 'change' }
          ],
          dataTableName: [
            { required: true, message: '请输入数据表名', trigger: 'blur' }
          ]
        },
        dataPreviewColumns: [
          {type: 'selection', width: 100, align: 'center'},
          {title: '字段名', key: 'nameSpace'},
          { title: '字段类型',  key: 'name',
            render: (h, params) => {
              return h('Select',{style: {width: '100px'}, attrs: {placeholder: params.row.name}},
                this.columnName.map((column) => {
                  return h('Option', {attrs: {value: column}}, [h('span',[column])]);
                })
              );
            }
          },
          { title: '引入类型', key: 'type' },
          { title: '引入完整性', key: 'integrity' },
          { title: '占用存储', key: 'storage' },
          { title: '创建时间', key: 'createTime', sortable: true},
          { title: '修改时间', key: 'editTime', sortable: true}
        ],
        dataPreviewData: [
          { nameSpace: 'test_data ', name: '呵呵', type: '深拷贝', integrity: '引入完整性',
            storage: '19 KB', createTime: 12, editTime: 12
          },
          { nameSpace: 'test_data ', name: '呵呵', type: '深拷贝',
            integrity: '引入完整性', storage: '19 KB', createTime: 11, editTime: 2
          },
          { nameSpace: 'test_data ', name: '呵呵', type: '深拷贝',
            integrity: '引入完整性', storage: '19 KB', createTime: 1, editTime: 222
          },
          { nameSpace: 'test_data ', name: '呵呵', type: '深拷贝',
            integrity: '引入完整性', storage: '19 KB', createTime: 22, editTime: 12
          }
        ]
      }
    },
    methods: {
      importData(){
        this.$emit('importStatus', true);
        const id = parseInt(Math.random() * 100000)
        const route = {
          name: 'import-status',
          params: {
            id
          },
          meta: {
            title: `动态路由-${id}`
          }
        }
        this.$router.push(route)
      }
    },
    mounted(){

    }
  }
</script>

<style >
.ivu-select-dropdown{
  z-index: 99999;
  position: relative;
}
</style>
![图片说明](https://img-ask.csdn.net/upload/201909/02/1567420031_279292.png)
![图片说明](https://img-ask.csdn.net/upload/201909/02/1567420041_157300.png)


  • 写回答

1条回答

  • qq_351734088 2019-09-03 10:42
    关注

    加上这个这个属性就好了
    图片说明

    或者加个!important
    .ivu-select-dropdown{z-index: 99999!important;}

    评论

报告相同问题?

悬赏问题

  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏