credential-list.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div>
  3. <credential-form-modal modal-id="newCredentialModal" :descriptions="creddescList" :create="true" :pcid="pcid"></credential-form-modal>
  4. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newCredentialModal">New Credential</button>
  5. <div v-for="credential in credentials" :key="credential.credid">
  6. <credential :credential="credential" :descriptions="creddescList"></credential>
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. props: {
  13. credentialList: {
  14. type: Array,
  15. required: true
  16. },
  17. descriptions: {
  18. type: Array,
  19. required: true
  20. },
  21. pcid: {
  22. type: Number
  23. },
  24. groupid: {
  25. type: Number
  26. }
  27. },
  28. data () {
  29. return {
  30. credentials: this.credentialList
  31. }
  32. },
  33. computed : {
  34. creddescList: function () {
  35. let list = {}
  36. this.descriptions.map(val => {
  37. list[val.creddescid] = val.credtitle
  38. })
  39. return list
  40. }
  41. },
  42. }
  43. </script>