Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. selection_status = {key: ‘key’, label: ‘label’}
  2.  
  3.  
  4.  
  5. <v-select
  6. v-model="selection_status"
  7. data-vv-name="userRow.status"
  8. :options="customerStatusValueArray"
  9. v-validate="'required'"
  10. id="status"
  11. name="status"
  12. class="form-control editable_field"
  13. placeholder="Select option"
  14. ></v-select>
  15.  
  16.  
  17. data() {
  18. return {
  19. ...
  20. selection_status: null,
  21.  
  22.  
  23. mounted() {
  24. this.loadCustomer();
  25. }, // mounted() {
  26.  
  27.  
  28. loadCustomer() {
  29. axios.get(window.API_VERSION_LINK + 'personal/customers/' + this.user_id).then((response) => {
  30. this.userRow = response.data.user;
  31.  
  32. this.customerStatusValueArray.map((nextCustomerStatusValue, index) => {
  33. if (nextCustomerStatusValue.key == this.userRow.status) {
  34. this.selection_status = {key: this.userRow.status, label: nextCustomerStatusValue.label};
  35. }
  36. });
  37. ...
  38.  
  39. computed: {
  40. customerStatusValueArray() {
  41. return this.$store.getters.customerStatusValueArray;
  42. },
  43.  
  44. this.loadCustomer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement