<template>
  <div>
    <a-button-group>
      <a-button @click='handleClick('left')'>Left</a-button>
      <a-button @click='handleClick('right')'>Right</a-button>
    </a-button-group>
  </div>
</template>
<script setup>
import { ref } from 'vue';
import { Button, ButtonGroup } from 'ant-design-vue';

const activeButton = ref('');

function handleClick(direction) {
  activeButton.value = direction;
}

</script>
<style scoped>
</style>
Ant Design Vue 按钮组件示例:使用 ref 和 function 生成 Vue3 代码

原文地址: https://www.cveoy.top/t/topic/mEBa 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录