<template>
<view class="content">
<view class="nav-icons">
<view class="icon-item" v-for="(item, index) in arr" :key="item" @click="goClassify(index + 1)">
<view class="title">美食{{item}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
arr: [1,2,3,4,5]
}
},
methods: {
goClassify(id) {
uni.navigateTo({
url: `/pages/classify/index?id=${id}`
})
},
},
}
</script>
pages.json
{
"pages": [
{
"path": "pages/index/index",
"style": {
"app-plus":{
"scrollIndicator": "none",
"titleNView": false
}
}
},
{
"path": "pages/classify/index"
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "123123",
"navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor": "#FFFFFF",
"h5": {
"titleNView": false
}
}
}