<template>
  <div>
    <button @click="addRow">添加行</button>
    <el-row v-for="(row, index) in rows" :key="index">
      <el-select v-model="row.selectedValue">
        <el-option label="选项 1" value="option1"></el-option>
        <el-option label="选项 2" value="option2"></el-option>
        <el-option label="选项 3" value="option3"></el-option>
      </el-select>
    </el-row>
  </div>
</template>
<script>
export default {
  data() {
    return {
      rows: []
    };
  },
  methods: {
    addRow() {
      this.rows.push({
        selectedValue: ''
      });
    }
  }
};
</script>

原文地址: https://www.cveoy.top/t/topic/p4ln 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录