<template>
  <div id="app">
    <div id="bunt-teleport-target"></div>
    <bunt-select
      ref="activeTestObject"
      v-model="activeTestObject"
      name="active-test-object"
      label="Preview Test Object"
      :options="orderedTestObjects"
      dropdownClass="test-object-dropdown"
    ></bunt-select>
    <button @click.stop.prevent="update()">Update value</button>
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    const options = [
      {
        label: 'one',
        id: 1,
      },
      {
        label: 'two',
        id: 2,
      },
      {
        label: 'three',
        id: 3,
      },
    ];

    return {
      activeTestObject: options[0].id,
      orderedTestObjects: options,
    };
  },
  methods: {
    update() {
      this.orderedTestObjects.find(
        (option) => option.id === this.activeTestObject
      ).label = Math.random();
    },
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

svg.outline {
  display: none;
}
</style>
