Commit be0697f1 by Jony.L

fix首页计算资源跳转

parent 6a8d857c
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
<p class="info">{{ i.information }}</p> <p class="info">{{ i.information }}</p>
<div class="btn-box"> <div class="btn-box">
<button aria-disabled="false" type="button" <button aria-disabled="false" type="button"
class="el-button el-button--default is-plain"> class="el-button el-button--default is-plain"
@click="goToDetail(i)"
>
<span class="">了解详情</span> <span class="">了解详情</span>
</button> </button>
</div> </div>
...@@ -217,6 +219,17 @@ const infoList = ref([]) ...@@ -217,6 +219,17 @@ const infoList = ref([])
const infoBottomList = ref([]) const infoBottomList = ref([])
const router = useRouter() const router = useRouter()
// 跳转处理函数
const goToDetail = (item) => {
if (!item.url) {
console.warn('当前资源没有跳转链接', item);
return;
}
window.open(item.url, '_blank');
};
function updateHeight() { function updateHeight() {
// 根据窗口宽度计算高度 // 根据窗口宽度计算高度
const width = window.innerWidth; const width = window.innerWidth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment