这里只是简单的说说如何在vue中使用,想看更多的可以移步此插件官网,很详细http://craftpip.github.io/jquery-confirm/
安装和全局引用就不多说了,很简单npm,import就好了
需要注意的是,要引入css文件,否则样式不会被加载进来
<template>
<div class="">
<button type="button" class="buy_bt" @click="buy_submit">确认购买</button>
</div>
</template>
methods:{
buy_submit(){
$.alert({
title: '提示:',
content: '<p>您已购买'+' '+this.shuzi_inp+' 个拍品</p>'+'<p>总计:'+this.xiaoji+'</p>',
buttons: {
'确认': function () {
window.location.href="/index"
},
}
});
},
}