7 个回答

在data里面定义一个变量,比如showDialog:false,在methods里面调用点击方法

modifyClick(){
    this.showDialog = true
}

vue好像不支持动态添加dom

设置下改弹窗的z-index,可能挡住了吧

首先是确定方法是否被调用了?
其次再确定弹窗为true是否能正确弹窗?

Updates the element’s innerHTML. Note that the contents are inserted as plain HTML - they will not be compiled as Vue templates. If you find yourself trying to compose templates using v-html, try to rethink the solution by using components instead.

文档

可能需要换个思路,比如默认渲染好下面操作的几个按钮

vue添加动态dom方法请看下图

clipboard.png

你返回的字符串,用vue的v-html渲染成html标签,只有你写的方法在里面就没有啥子问题了,点击把弹框变量设置成true就可以了。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题