<template>
<gracePage headerBG="#FFFFFF" :customHeader="false">
<view slot="gBody" class="grace-body">
<view class="grace-margin-top" style="text-align:right;">
<text class="grace-text grace-blue" style="margin-right:25rpx;" @tap="addAddress">+ 添加新地址 </text>
</view>
<view class="grace-list grace-margin-top">
<view class="grace-list-items" v-for="(item, index) in forData" :key="index">
<view class="grace-list-body">
<view class="grace-list-title">
<text class="grace-list-title-text">姓名</text>
<text class="grace-list-title-desc">181****5688</text>
</view>
<view class="grace-list-body-desc">具体地址信息</view>
</view>
<text class="grace-list-arrow-right grace-icons icon-arrow-right" @tap="editAddress"></text>
</view>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/components/gracePage.vue";
export default {
data() {
return {
forData : [1,2,3,4,5] //模拟的循环数据
};
},
methods:{
editAddress : function(){
uni.showToast({
title:"请以新增页面为基础改进",
icon:'none'
})
},
addAddress : function(){
uni.showToast({
title: "请使用 wx.navigate 进行页面切换",
icon: 'none'
})
}
},
components:{gracePage}
}
</script>
<style>
</style>
<template>
<gracePage headerBG="#FFFFFF" :customHeader="false">
<view slot="gBody" class="grace-body">
<view class="grace-margin-top">
<text class="grace-text grace-blue" style="margin-right:25rpx; text-align:right;" @tap="addAddress">+ 添加新地址 </text>
</view>
<view class="grace-list grace-margin-top">
<view class="grace-list-items" v-for="(item, index) in forData" :key="index">
<view class="grace-list-body">
<view class="grace-list-title">
<text class="grace-list-title-text">姓名</text>
<text class="grace-list-title-desc">181****5688</text>
</view>
<text class="grace-list-body-desc">具体地址信息</text>
</view>
<text class="grace-list-arrow-right grace-icons" @tap="editAddress"></text>
</view>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/weexComponents/gracePage.nvue";
export default {
data() {
return {
forData : [1,2,3,4,5] //模拟的循环数据
};
},
methods:{
editAddress : function(){
uni.showToast({
title:"请以新增页面为基础改进",
icon:'none'
})
},
addAddress : function(){
uni.showToast({
title: "请使用 wx.navigate 进行页面切换",
icon: 'none'
})
}
},
components:{gracePage}
}
</script>
<style>
</style>
.wxml
<gracePage headerBG="#FFFFFF" customHeader="{{false}}">
<view slot="gBody" class="grace-body">
<view class="grace-margin-top" style="text-align:right;">
<text class="grace-text grace-blue" style="margin-right:25rpx;" bindtap="addAddress">+ 添加新地址 </text>
</view>
<view class="grace-list grace-margin-top">
<view class="grace-list-items" wx:for="{{forData}}" wx:key="index">
<view class="grace-list-body">
<view class="grace-list-title">
<text class="grace-list-title-text">姓名</text>
<text class="grace-list-title-desc">181****5688</text>
</view>
<view class="grace-list-body-desc">具体地址信息</view>
</view>
<text class="grace-list-arrow-right grace-icons icon-arrow-right" bidntap="editAddress"></text>
</view>
</view>
</view>
</gracePage>.js
Page({
data: {
forData: [1, 2, 3, 4, 5] //模拟的循环数据
},
editAddress: function () {
wx.showToast({
title: "请以新增页面为基础改进",
icon: 'none'
})
},
addAddress : function(){
wx.showToast({
title: "请使用 wx.navigate 进行页面切换",
icon: 'none'
})
}
}).json
{
"usingComponents": {
"gracePage": "../../graceUI/components/gracePage"
}
}