我遇到一个问题 就是对象显示在pre标签的时候,function不见了。
比如自定义了一个对象
test:{
title:'aaa',
fomatter:function(){
return 'aa'
}
},
用v-html填充代码
<pre id="editor" v-html="test"></pre>
function还是不见了,有什么办法能把function显示出来吗?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
JSON.stringify()
是会忽略函数的