selectIndex變數移除後未處理

来源:6-3 底部 TabBar 切换路由

慕数据7359240

2020-02-11

scrollable-tab.component.html
這裡有一個變數(selectIndex)
對應不到(scrollable-tab.component.ts)

写回答

2回答

慕数据7359240

提问者

2020-02-12

課程中scrollable-tab.component.html裡有一段代碼如下:

<a  [ngStyle]="{color: i == selectIndex ? titleActiveColor : titleColor}"

  (click)="handleSelection(i)">{{ menu.title }}</a>

這段代碼裡的selectIndex在scrollable-tab.component.ts移除了

但程式是可執行的



0
0

接灰的电子产品

2020-02-11

没明白你的意思,具体说说

0
1
慕标2085634
他的意思是说:你在html模板上有使用selectedIndex 这个属性,但是selectedIndex 在ts文件中的定义被你删掉了,运行会报异常Unresolved variable or type selectedIndex
2024-03-17
共1条回复

Angular 开发拼多多webapp 从基础到项目实战

高仿拼多多WebApp,带你在实战环境中学习Angular

1322 学习 · 451 问题

查看课程