问题描述:
Failed to execute ‘removeChild’ on ‘Node’: The node to be removed is not a child of this node.
问题背景:
在我之前的博文
VUEJS项目实践五之Dialog弹出框MessageBox(超好看的bootstrap样式)
中有介绍一个样式结合了Bootstrap样式的MesageBox
然后在之前的博文
VUEJS项目实践四之自定义键盘指令(按键即获取焦点)
中介绍了一种按键自动获取焦点,并触发事件的方法。
现在在MessageBox绑定按键Enter的时候,发现报错
messageBox.vue?cb02:80 Uncaught DOMException: Failed to execute ‘removeChild’ on ‘Node’: The node to be removed is not a child of this node.
首先贴一下Message.vue文件
<template>
<div v-key-bind-listen>
<div class="msgBox" v-show="isShowMessageBox">
<div class="msgBox_header">
<div class="msgBox_title">
<h3>{
{
title }}</h3>
</div>
</div>
<div class="msgBox_content">
<p>{
{
content }}</p>
</div>
<div class="msgBox_btns">
<button type="button" class="btn btn-lime btn-lg" id="confirmBtn" @click="confirm" bind_key="ENTER">确定</button>
<button type="button" class="btn btn-dark