Commit d714bab7 by jlc

update:解决控制台报错

parent dc09d994
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<el-icon><MapLocation /></el-icon> <el-icon><MapLocation /></el-icon>
<span>点的案例</span> <span>点的案例</span>
</template> </template>
<el-menu-item v-for="item in elementPointData" :key="item.id" @click="goAnchor(item.title)"> <el-menu-item v-for="item in elementPointData" :key="item.id" :index="item.title" @click="goAnchor(item.title)">
<el-icon><View /></el-icon> <el-icon><View /></el-icon>
<span>{{item.title}}</span> <span>{{item.title}}</span>
</el-menu-item> </el-menu-item>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<el-icon><SemiSelect /></el-icon> <el-icon><SemiSelect /></el-icon>
<span>线的案例</span> <span>线的案例</span>
</template> </template>
<el-menu-item v-for="item in elementLineData" :key="item.id" @click="goAnchor(item.title)"> <el-menu-item v-for="item in elementLineData" :key="item.id" :index="item.title" @click="goAnchor(item.title)">
<el-icon><View /></el-icon> <el-icon><View /></el-icon>
<span>{{item.title}}</span> <span>{{item.title}}</span>
</el-menu-item> </el-menu-item>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<el-icon><Grid /></el-icon> <el-icon><Grid /></el-icon>
<span>面的案例</span> <span>面的案例</span>
</template> </template>
<el-menu-item v-for="item in elementPlaneData" :key="item.id" @click="goAnchor(item.title)"> <el-menu-item v-for="item in elementPlaneData" :key="item.id" :index="item.title" @click="goAnchor(item.title)">
<el-icon><View /></el-icon> <el-icon><View /></el-icon>
<span>{{item.title}}</span> <span>{{item.title}}</span>
</el-menu-item> </el-menu-item>
...@@ -62,7 +62,7 @@ const props = defineProps({ ...@@ -62,7 +62,7 @@ const props = defineProps({
} }
}); });
// 锚点定位跳转 // 锚点跳转函数
function goAnchor(title) { function goAnchor(title) {
var anchor = document.getElementById(title); var anchor = document.getElementById(title);
if (anchor) { if (anchor) {
......
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 to comment