Modify contenteditable="true" attribute in vue, add contenteditable attribute to dom element in vue

Find the class of the element that needs to be added or modified

<div  class="w-e-text"></div>
  var edit=document.getElementsByClassName('w-e-text')[0]
  edit.setAttribute('contenteditable','false');

Can be modified

Scan the code to get 1000+ collections of front-end interview questions and try them out later

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_42981560/article/details/110389219