search

Home  >  Q&A  >  body text

javascript - js vue project pre code display problem

I encountered a problem. When the object is displayed in the pre tag, the function disappears.
For example, if you customize an object

test:{
    title:'aaa',
    fomatter:function(){
        return 'aa'
    }
},

Fill the code with v-html

<pre  id="editor" v-html="test"></pre>

The function is still missing. Is there any way to display the function?

伊谢尔伦伊谢尔伦2778 days ago787

reply all(1)I'll reply

  • 代言

    代言2017-07-05 10:49:04

    JSON.stringify() will ignore the function

    reply
    0
  • Cancelreply