Vue uses a string to bind a vMub model, why it can't get a value.

  var message ;
  if(type==1){
    message = "<p style="color:-sharpa79d9d">10

<input v-model="userName" type="text" placeholder="" style="width:80%"/>"; title = ""; }

Sep.23,2021

since your code is incomplete, I guess you are trying to parse the HTML in the message string using v-html . The official documentation has made it clear that the content in v-html is inserted as normal HTML-it will not be compiled as a Vue template.

clipboard.png

you can use v-if in the html tag to control conditional rendering of HTML elements, or v-show to control display hiding.

Complete code on

.

Menu