basic.vue 799 B

1234567891011121314151617181920212223242526272829
  1. <script setup lang="tsx">
  2. import { theme } from 'ant-design-vue';
  3. import { Conversations } from 'ant-design-x-vue';
  4. import type { ConversationsProps } from 'ant-design-x-vue';
  5. import { computed } from 'vue';
  6. defineOptions({ name: 'AXConversationsBasic' });
  7. const items: ConversationsProps['items'] = Array.from({ length: 4 }).map((_, index) => ({
  8. key: `item${index + 1}`,
  9. label: `Conversation Item ${index + 1}`,
  10. disabled: index === 3,
  11. }));
  12. const { token } = theme.useToken();
  13. // Customize the style of the container
  14. const style = computed(() => ({
  15. width: '256px',
  16. background: token.value.colorBgContainer,
  17. borderRadius: token.value.borderRadius,
  18. }));
  19. defineRender(() => {
  20. return (
  21. <Conversations items={items} defaultActiveKey="item1" style={style.value} />
  22. )
  23. })
  24. </script>