<script setup lang="ts">
import { onMounted, reactive, watchEffect } from 'vue';

const props = defineProps<{
  params: any;
}>();

/**
 * buttons: [
 *   {
 *     tooltip: '删除',
 *     round: true,
 *     icon: 'add',
 *     unelevated: true,
 *     callback: (data: any) => {
 *       onDel(data);
 *     },
 *   },
 * ];
 */

const state = reactive({
  buttons: [],
});

watchEffect(() => {
  state.buttons = props.params.buttons;
});

onMounted(() => {
  console.log('props', props.params);
});
</script>
<template>
  <div>
    <div class="q-gutter-xs">
      <q-btn color="primary" label="按钮1" />
      <q-btn color="primary" label="按钮2" />
    </div>
  </div>
</template>

<style lang="scss" scoped></style>
