//滾動到選中定位的位置 selectedRegion() { // 通過Id獲取到對應的dom元素 const node = document.getElementById(this.sertCurrnetKey) setTimeout(() => { if (node) { this.$nextTick(() => { // 通過scrollIntoView方法將對應的dom元素定位到可見區域 【block: 'center'】這個屬性是在垂直方向居中顯示 node.scrollIntoView({ behavior: 'smooth', // 平滑過渡 值有auto、instant,smooth,緩動動畫(當前是慢速的) block: 'center', }) }) } }, 100) },