antdVue提醒框怎么添加点击事件?

用的是antdVue的对话框

this.$success({
    title: 'This is a success message',
    content: ...,
});

接口会返多个流水号,在content中展示,对每条流水号支持点击事件

image.png

现在是能进行展示但没法添加点击事件,要再content中做什么处理呢,请各位大神指点!

阅读 2.3k
1 个回答

你如果用的是对话框那可以封装一个组件,自己定义一下结构,直接给内容绑定事件方法就行了。
官网有案例的

如下

<template>
  <div>
    <a-button type="primary" @click="showModal">
      Open Modal with customized button props
    </a-button>
    <a-modal
      v-model="visible"
      title="Basic Modal"
      :ok-button-props="{ props: { disabled: true } }"
      :cancel-button-props="{ props: { disabled: true } }"
      @ok="handleOk"
    >
      <p>Some contents...</p>
      <p>Some contents...</p>
      <p>Some contents...</p>
    </a-modal>
  </div>
</template>
<script>
export default {
  data() {
    return {
      visible: false,
    };
  },
  methods: {
    showModal() {
      this.visible = true;
    },
    handleOk(e) {
      console.log(e);
      this.visible = false;
    },
    handleCancel(e) {
      console.log(e);
      this.visible = false;
    },
  },
};
</script>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题