Vue.js 如何使用Vue js将div替换为html onclick?

Vue.js 如何使用Vue js将div替换为html onclick?,vue.js,Vue.js,我在一个div中有一个响应按钮,它附带了一个模态 <div v-if="notification ? notification.type === 'App\\Notifications\\InterviewRequestEmployerReply' : ''"> <button class="btn btn-primary btn-sm text-right" @click="editNotificationRequest(notification)">Respo

我在一个div中有一个响应按钮,它附带了一个模态

<div v-if="notification ? notification.type === 'App\\Notifications\\InterviewRequestEmployerReply' : ''">
    <button class="btn btn-primary btn-sm text-right" @click="editNotificationRequest(notification)">Respond</button>
</div>
我的方法:

createConfirmedInterviewRequest: async function() {
   this.confirmProcess(`data`);
}
带按钮的模态:

<b-button type="submit" variant="success" @click="confirmProcess(`data`)" class="mr-2 mt-2">
   <i class="fas fa-handshake"></i>Confirm Interview
</b-button>
“响应”按钮我想消失并替换为“确认”

如果您需要知道通知中的数据属性,请告诉我。

使用v-if、v-else,条件将在您的editNotificationRequest方法中更改:


我是将ClickConfirm添加到数据中,还是这应该是一种方法?更易于使用的数据属性,虽然它可以根据您的确认值计算属性,但您不需要手动更改它。我的代码使用service.js文件发出axios请求,我使用v-for显示数据库中的所有数据。我不确定你到底需要什么…如果你给我看一个例子,你有一个方法可以做任何事情,然后在这个方法中,另一个方法可以做我所要求的。数据可以是任何内容…示例按数据属性实现
<b-button type="submit" variant="success" @click="confirmProcess(`data`)" class="mr-2 mt-2">
   <i class="fas fa-handshake"></i>Confirm Interview
</b-button>
<div v-if="notification ? notification.type === 'App\\Notifications\\InterviewRequestEmployerReply' : ''">
                        <button class="btn btn-primary btn-sm text-right" @click="editNotificationRequest(notification)" v-if="!computedConfirm">Respond</button>
<div v-if="notification ? notification.type === 'App\\Notifications\\InterviewRequestEmployerReply' : ''">
    <button v-if="clickConfirmed" class="btn btn-primary btn-sm text-right" @click="editNotificationRequest(notification)">Respond</button>
    <strong v-else class="text-success">Confirmed</strong>
</div>