javascript - 我无法在 Alpine JS 中确定此消息的原因
问题描述
我收到此错误,不知道如何解决:
alpine.js:115 Alpine Error: "ReferenceError: Invalid left-hand side in assignment"
Expression: "getTasks() = rightSideOfExpression($event, getTasks())"
Element: <input class="shadow appearance-none border rounded w-1/3 py-2 px-2 my-1 mx-1 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="valorvenda" type="text" placeholder="Valor" autofocus x-ref="valorvenda" @keydown.enter="addTask($refs.valorvenda.id)">
u @ alpine.js:115
(anonymous) @ alpine.js:132
<input class="shadow appearance-none border rounded w-1/3 py-2 px-2 my-1 mx-1 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="valorvenda" type="text" placeholder="Valor" autofocus="" x-ref="valorvenda" @keydown.enter="addTask($refs.valorvenda.id)">
VM5454749:3 Uncaught (in promise) ReferenceError: Invalid left-hand side in assignment
at eval (eval at d.el (alpine.js:174), <anonymous>:3:21)
at d.el (alpine.js:174)
at d (alpine.js:131)
at alpine.js:151
at be.evaluateCommandExpression (alpine.js:1760)
at z (alpine.js:933)
at HTMLDivElement.l (alpine.js:909)
并且不知道我在做什么!你能帮我吗?
解决方案
您可能打算比较而不是分配。更改=
为==
:
getTasks() == rightSideOfExpression($event, getTasks())
推荐阅读
- javascript - 如何在本机反应中突出显示单个按钮?
- r - R:这张图有意义吗?(了解图表,COVID-19 的应用)
- android - flutter工具无法访问文件
- google-bigquery - BigQuery - 在多个组中为多个列计算 0 - 100 个百分位数
- html - CSS Flex 容器问题
- uml - UML - 如何将类图与子类垂直对齐
- json - 使用 jq 创建带有字符串变量作为参数的 json
- xml - 如何获得两个xpath节点集的交集
- c# - 将嵌套对象转换为数组
- mysql - MySQL 8.0.22 指定为定义者('root'@'%')的用户不存在