
const vue = new Vue()
window.addEventListener('message', async (e) => {
  if (e.data.type === 'confim') {
    // console.log($confirm)
    await confirm(e)
  }
})
async function confirm (e) {
  vue.$confirm(e.data.title, '操作提示', { type: 'warning' })
    .then(() => {
      console.log(e)
      e.source.postMessage({ status: true, id: e.data.id }, '*')
    })
    .catch(() => {
      e.source.postMessage({ status: false, id: e.data.id }, '*')
    })
}
