wxs文件:
var imgUrl = "https://***/";
module.exports = {
imgUrl:imgUrl
}
index.vue 内容
<template>
<view class="content">
<view class="text-area">
<view class="title" v-for="(item,index) in toolArrayOne" :key="index">
<image :src="appconfig.imgUrl+item.icon"></image>
</view>
</view>
</view>
</template>
<script module="appconfig" lang="wxs" src="../../common/appconfig.wxs"></script>
<script>
export default {
data() {
return {
toolArrayOne :[{
label: '项目1',
icon: 'index/index-icon-1.png',
show: true,
authc:'login',
},
{
label: '项目2',
icon: 'index/index-icon-2.png',
show: true,
authc:'login',
}, {
label: '项目3',
icon: 'index/index-icon-3.png',
show: true,
authc:'login',
}, {
label: '项目4',
icon: 'index/index-icon-4.png',
show: true,
authc:'login',
}, {
label: '项目5',
icon: 'index/icon-11.png',
show: true,
authc:'login',
}, {
label: '项目6',
icon: 'index/index-icon-5.png',
show: true,
authc:'login',
}, {
label: '项目7',
icon: 'index/index-icon-6.png',
show: true,
authc:'login',
}, {
label: '项目8',
icon: 'index/index-icon-8.png',
show: true,
authc:'login',
},
]
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.text-area {
display: flex;
justify-content: center;
flex-direction: column;
}
</style>