【发布时间】:2019-03-28 18:46:23
【问题描述】:
我是 ionic 3 的新手,想了解代码,请帮帮我。 我想选择任何项目,它的值得到的更改小计可能会反映到它的输出。
cart.ts
private _values1 = [" 1 ", "2", " 3 "," 4 "," 5 "," 6 "];
firstDropDownChanged(_values1: any)
{
this.currentPrice = (parseInt(this.product.subtotal) * this._values1);
console.log(this.currentPrice);
this.product.subtotal =this.currentPrice;
console.log(this.product._values1);
}
cart.html
<span style="font-size: 14px !important;">Qty:</span>
<select class="sel" (change)="firstDropDownChanged()">
<option *ngFor='let v of _values1'>{{ v }}</option>
</select>
【问题讨论】:
-
你没有传递参数
(_values1: any) -
你忘记在 firstDropDownChanged 中传递参数
-
解释一下,我实际上不知道我在做什么..?今天提交很紧急..!
-
使用
(ionChange)="abc($event)"。 -
下面提供的答案代码将满足您的需求。您缺少传入的参数。还有您的紧急情况!= 我们的紧急情况。
标签: javascript html angular typescript ionic-framework