vue的方法中为什么有的需要加引号

    xiaoxiao2025-02-16  55

    找到这样一个答案,听起来是这么回事,比如有function A(){},那么如果$name = 'A',$name()解析出来就是函数A()。

    还有就是绑定属性时,有些也应该加引号:使用v-bind时,当key中含有js不支持的变量命名格式,如:-(中划线)和空格。

    参考https://www.imooc.com/qadetail/198399

           https://blog.csdn.net/chenyHahaha/article/details/78316322

    最新回复(0)