日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

在excel里寫一行數字,復制后直接粘貼到表格不同列

作者:Ybittersweet 更新時間: 2023-07-24 編程語言
<td v-for="(item, i) in list" :key="'漢堡' + item" class="td-num">
              <el-input
                v-model="form['remark' + (12 + i)]"
                @input="onInput($event, form, i, 1)"
                placeholder="請輸入"
                class="noneBorderInput"
              />
            </td>
<td v-for="(item, i) in list" :key="'薯條' + item" class="td-num">
              <el-input
                v-model="form['remark' + (20 + i)]"
                @input="onInput($event, form, i, 2)"
                placeholder="請輸入"
                class="noneBorderInput"
              />
            </td>
 onInput(value, form, index, row) {
      // 獲取粘貼內容
      // const value = e.target.value;
      if (!value) {
        return;
      }
      // 粘貼內容分隔成數組
      const values = value.split(" ");
      values.forEach((line, num) => {
        const lines = line
          .replace(/\t/g, " ")
          .trim()
          .split(/\s+/);
        // 將數組每項賦給對應的remark
        if (values.length > 1) {
          // 多行
          lines.forEach((v, i) => {
            if (this.list.length + 1 >= i) {
              form["remark" + ((num === 0 ? 12 : 20) + index + i)] = v;
            }
          });
        } else {
          // 單行
          lines.forEach((v, i) => {
            if (this.list.length + 1 >= i) {
              form["remark" + ((row === 1 ? 12 : 20) + index + i)] = v;
            }
          });
        }
      });
    }

原文鏈接:https://blog.csdn.net/Ybittersweet/article/details/129851561

  • 上一篇:沒有了
  • 下一篇:沒有了
欄目分類
最近更新