Live2d Test Env

想了个需求,如题目

data:

                demo: 'bacdefghijk'

web:

 <h1>{{str(demo)}}</h1>

 methods:

 str(value) {
                    return value.replace(value.substring(3, value.length - 4), '****')
                }

也可以在computed中使用,但限于知识,无法做到复用

web:

        <h1>{{str}}</h1>

computed:

  str() {
                    return this.demo.replace(this.demo.substring(3, this.demo.length - 4), '****')
                }

这个问题研究了一上午,尚未解出。如有理解的,欢迎指教

不胜感激,以上。

原文地址:https://www.cnblogs.com/hjk1124/p/12272625.html