[转]v-mode 提示错误 v-model directives require the attribute value which is valid as LHS.

v-mode总是提示错误 v-model  directives require the attribute value which is valid as LHS. 为什么调用过滤总是提示这个错呢?解决方法v-model 的值只能是一个变量,是无法应用 filter 的。

v-mode总是提示错误 v-model  directives require the attribute value which is valID as LHS.

为什么调用过滤总是提示这个错呢?

解决方法

v-model 的值只能是一个变量,是无法应用 filter 的。如果需要应用 filter:

复制代码
v-model="msgFilteredHTML"
 
export default {
    ...
    computed: { 
        msgFilteredHTML: {
            get() {
                return this.filterHTML(this.msg)
            },
            set(val) {
                this.msg = val
            }
        }
    }
}
复制代码

链接1:v-mode 提示错误 v-model directives require the attribute value which is valid as LHS.

链接2:‘v-model‘ directives require the attribute value which is valid as LHS

链接3:vue3.0 v-model value must be a valid JavaScript member expression.

posted @   rainbow70626  阅读(5478)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 终于写完轮子一部分:tcp代理 了,记录一下
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
历史上的今天:
2019-07-08 [转]MyEclipse基础学习:Java EE Learning Center
2019-07-08 [转]Myeclipse四种方式发布项目
2019-07-08 [转]Myeclipse之web项目的部署(发布)流程
点击右上角即可分享
微信分享提示