Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="app">
  <h1>Vue Select</h1>

  <table class="table table-stripped table-bordered">
    <tr>
      <th style="width: 20%;">Emission Source Name</th>
      <th style="width: 40%;">Responsible person</th>
      <th style="width: 40%;">Методика расчета</th>
      <th style="width: 40%;"></th>
    </tr>
    <tr v-for="releaseSource in releaseSources">
      <td>{{ releaseSource.name }}</td>
      <td>
        <v-select :options="users" label="fullname" :value="releaseSource.responsible" @input="responsible => updateResponsible(releaseSource, responsible)" />
      </td>
      <td>
        <v-select :options="calcmethods" label="calcMethodName" :value="releaseSource.calcmethod" @input="calcmethod => updateCalcMethod(releaseSource, calcmethod)" />
      </td>
      <td class="text-right"><button class="btn btn-sm btn-outline-danger" @click.prevent="deleteItem(index)">Delete item</button></td>
    </tr>
    <tr>
      <td colspan="4">
        <button class="btn btn-sm btn-primary" @click.prevent="addRow">Add row</button>
      </td>
    </tr>
  </table>

  <textarea class="form-control" rows="5">{{ releaseSources || 'null' }}</textarea>

</div>
              
            
!

CSS

              
                body {
  font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizelegibility;
  -moz-osx-font-smoothing: grayscale;
  -moz-text-size-adjust: none;
}

              
            
!

JS

              
                Vue.component("v-select", VueSelect.VueSelect);

const users = [
  {
    fullname: "Коваленко Вячеслав Станиславович",
    email: "kovalsky@mail.ru"
  },
  {
    fullname: "Дорофеев Матвей Брониславович",
    email: "dorofey@mail.ru"
  },
  {
    fullname: "Горшков Харитон Ярославович",
    email: "gorshok@mail.ru"
  },
  {
    fullname: "Петров Осип Валерьевич",
    email: "petroff@mail.ru"
  },
  {
    fullname: "Мазайло Эрик Виталиевич",
    email: "maz-edik@mail.ru"
  },
  {
    fullname: "Ефимов Карл Артёмович",
    email: "effim@mail.ru"
  },
  {
    fullname: "Орлов Фёдор Вадимович",
    email: "the-eagle@mail.ru"
  },
  {
    fullname: "Бутко Адриан Анатолиевич",
    email: "but-co@mail.ru"
  },
  {
    fullname: "Сирко Денис Максимович",
    email: "sir-co@mail.ru"
  },
  {
    fullname: "Семёнов Влад Сергеевич",
    email: "semenov-vlad@mail.ru"
  }
];

const calcmethods = [
  { calcMethodId: "11", calcMethodName: "Методика расчета 1" },
  { calcMethodId: "22", calcMethodName: "Методика расчета 2" },
  { calcMethodId: "33", calcMethodName: "Методика расчета 3" },
  { calcMethodId: "44", calcMethodName: "Методика расчета 4" }
];

new Vue({
  el: "#app",
  data: () => ({
    releaseSources: [
      {
        uid: 1,
        name: "Power Generator CAT 334",
        responsible: "",
        calcmethod: {}
      },
      {
        uid: 2,
        name: "Welding machine Miller 123",
        responsible: "",
        calcmethod: {}
      },
      {
        uid: 3,
        name: "Compressor Atlas COPCO 111",
        responsible: "",
        calcmethod: {}
      }
    ]
  }),
  methods: {
    updateResponsible(releaseSource, responsible) {
      releaseSource.responsible = responsible;
    },
    updateCalcMethod(releaseSource, calcmethod) {
      releaseSource.calcmethod = calcmethod;
    },
    addRow() {
      this.releaseSources.push({
        uid: "",
        name: "",
        responsible: "",
        calcmethod: {}
      });
    },
    deleteItem(index) {
      this.releaseSources.splice(index, 1);
    }
  },
  computed: {
    users: () => users,
    calcmethods: () => calcmethods
  }
});

              
            
!
999px

Console