<template>
  <div class="opBtn">
    <VaButton color="info" :round="false" size="small" icon="preview" class="mr-6 mb-2" @click="showModal = true">
      查看角色用户
    </VaButton>
    <VaModal
      v-model="showModal"
      max-height="600px"
      :noDismiss="true"
      max-width="800px"
      ok-text="提交"
      cancelText="取消"
    >
      <h3 class="va-h3">用户列表</h3>
      <VaDataTable :items="items">
        <template #cell(img)="{ rowData }">
          <VaAvatar :src="rowData.img" />
        </template>
      </VaDataTable>
    </VaModal>
  </div>
</template>

<script>
  export default {
    name: 'previewManByRoleBtn',
    data() {
      return {
        showModal: false,
        items: [
          {
            img: 'https://randomuser.me/api/portraits/women/5.jpg',
            name: 'Audrey Clay',
            phone: '13327777156',
          },
          {
            img: 'https://randomuser.me/api/portraits/men/1.jpg',
            name: 'Aguirre Klein',
            phone: '13327777156',
          },
          {
            img: 'https://randomuser.me/api/portraits/men/3.jpg',
            name: 'Tucker Kaufman',
            phone: '13327777156',
          },
          {
            img: 'https://randomuser.me/api/portraits/men/5.jpg',
            name: 'Herbert Keller',
            phone: '286 NW. Shore St.Longwood, FL 32779',
          },
        ],
      }
    },
  }
</script>

<style scoped></style>
