# Vue 在iptv 中使用所需注意的事項
- ## 使用最新版vue-epg (2.3.0) 內置基于 iptv封裝的 遙控器響應事件
- ## 建議去除 keep-alive 模式,或采用其他方案
- ## 需加載 babel-polyfill 來做全兼容,@babel/polyfill無法做到全兼容
- ## 由于不支持 x-path 語法,默認使用 /div/div[1]的方式來記錄歷史焦點將被廢除,建議使用遍歷items的*isFocus*===true 來獲取并記錄索引的方式存儲。
### 示例代碼 ###
~~~
this.$service.items.every((item,index)=>{
if(item.isFocus){
save(this.$router.name,index) // 記錄當前頁面的焦點索引
}
})
//獲取默認焦點時
let pIndex = defaultPointerIndex;//之前記錄的焦點索引
this.$service.move(this.$service.items[pIndex]);//移動到該焦點上
~~~