<template>
  <div style="margin:20px">
    <div>
      <lu-batch-input
        @updated="updateArea"
        resetBtn
        :allList="allData"
        type="textarea"
        v-model="test"
      ></lu-batch-input>
    </div>

    <div style="margin-top:100px">
      <lu-batch-input
        @updated="updateArea2"
        clearable
        :update="inputUpdate"
        type="text"
        v-model="test2"
      ></lu-batch-input>
      <lu-button @click="updateInput">触发input</lu-button>
    </div>
  </div>
</template>

<script>
import { Notification } from "element-ui";
export default {
  data() {
    return {
      test: "111",
      test2: "222",
      inputUpdate: false,
      allData: [1, 2, 100, 101]
    };
  },
  methods: {
    updateArea(val, val1) {
      Notification.success({
        title: "数据更新",
        message: `Area处理后的数据为${val} 和 ${val1}`
      });
    },
    updateArea2(val, val1) {
      Notification.success({
        title: "数据更新",
        message: `Input处理后的数据为${val} 和 ${val1}`
      });
      this.inputUpdate = false;
    },
    updateInput() {
      this.inputUpdate = true;
    }
  }
};
</script>

<style></style>
