<template>
<gracePage :customHeader="false">
<!-- 页面主体 -->
<view slot="gBody" class="grace-body">
<view class="grace-margin-top">
<text class="grace-title">头像组演示</text>
</view>
<view>
<graceFaceGroup :items="faces"></graceFaceGroup>
</view>
<view class="grace-margin-top">
<text class="grace-title">带有按钮</text>
</view>
<graceFaceGroup :items="faces" :space="60" :isAddBtn="true" @addBtnClicked="addBtnClicked">
<view class="add-btn grace-icons icon-add"></view>
</graceFaceGroup>
<view class="grace-margin-top">
<text class="grace-title">在列表内使用</text>
</view>
<view class="grace-list">
<view class="grace-list-items">
<view class="grace-list-body">
<view class="grace-list-title">
<text class="grace-list-title-text">列表标题</text>
<view style="width:200rpx;">
<graceFaceGroup :size="50" :space="30" :items="faces"></graceFaceGroup>
</view>
</view>
</view>
</view>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/components/gracePage.vue";
import graceFaceGroup from "../../graceUI/components/graceFaceGroup.vue";
export default {
data(){
return {
faces : [
'http://img4.imgtn.bdimg.com/it/u=552119130,3001255642&fm=26&gp=0.jpg',
'http://img2.imgtn.bdimg.com/it/u=3428383444,2828052422&fm=26&gp=0.jpg',
'http://img2.imgtn.bdimg.com/it/u=1972994033,181763631&fm=26&gp=0.jpg',
'http://img1.imgtn.bdimg.com/it/u=291222564,3369340489&fm=26&gp=0.jpg',
'http://img3.imgtn.bdimg.com/it/u=3904304279,448031564&fm=26&gp=0.jpg'
]
}
},
components:{
gracePage, graceFaceGroup
},
onLoad : function () {},
methods:{
addBtnClicked : function () {
uni.showToast({
title:"您点击了按钮",
icon:"none"
});
// 请完善您的代码
}
}
}
</script>
<style>
.add-btn{text-align:center; line-height:80rpx; font-size:38rpx; background:#008CFF; color:#FFFFFF;}
</style>
<template>
<gracePage :customHeader="false">
<!-- 页面主体 -->
<view slot="gBody" class="grace-body">
<view class="grace-margin-top">
<text class="grace-title">头像组演示</text>
</view>
<view>
<graceFaceGroup :items="faces"></graceFaceGroup>
</view>
<view class="grace-margin-top">
<text class="grace-title">带有按钮</text>
</view>
<graceFaceGroup :items="faces" :space="60" :isAddBtn="true" @addBtnClicked="addBtnClicked">
<text class="add-btn">+</text>
</graceFaceGroup>
<view class="grace-margin-top">
<text class="grace-title">在列表内使用</text>
</view>
<view class="grace-list">
<view class="grace-list-items">
<view class="grace-list-body">
<view class="grace-list-title">
<text class="grace-list-title-text">列表标题</text>
<view style="width:200rpx;">
<graceFaceGroup :size="50" :space="30" :items="faces"></graceFaceGroup>
</view>
</view>
</view>
</view>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/weexComponents/gracePage.nvue";
import graceFaceGroup from "../../graceUI/weexComponents/graceFaceGroup.nvue";
export default {
data(){
return {
faces : [
'http://img4.imgtn.bdimg.com/it/u=552119130,3001255642&fm=26&gp=0.jpg',
'http://img2.imgtn.bdimg.com/it/u=3428383444,2828052422&fm=26&gp=0.jpg',
'http://img2.imgtn.bdimg.com/it/u=1972994033,181763631&fm=26&gp=0.jpg',
'http://img1.imgtn.bdimg.com/it/u=291222564,3369340489&fm=26&gp=0.jpg',
'http://img3.imgtn.bdimg.com/it/u=3904304279,448031564&fm=26&gp=0.jpg'
]
}
},
components:{
gracePage, graceFaceGroup
},
onLoad : function () {},
methods:{
addBtnClicked : function () {
uni.showToast({
title:"您点击了按钮",
icon:"none"
});
// 请完善您的代码
}
}
}
</script>
<style>
.add-btn{text-align:center; line-height:80rpx; font-size:38rpx; background-color:#008CFF; border-radius:80rpx; color:#FFFFFF;}
</style>
.wxml
<gracePage customHeader="{{false}}">
<!-- 页面主体 -->
<view slot="gBody" class="grace-body">
<view class="grace-margin-top">
<text class="grace-title">头像组演示</text>
</view>
<view>
<graceFaceGroup items="{{faces}}"></graceFaceGroup>
</view>
<view class="grace-margin-top">
<text class="grace-title">带有按钮</text>
</view>
<graceFaceGroup items="{{faces}}" space="{{60}}" isAddBtn="{{true}}" bind:addBtnClicked="addBtnClicked">
<view class="add-btn grace-icons icon-add"></view>
</graceFaceGroup>
<view class="grace-margin-top">
<text class="grace-title">在列表内使用</text>
</view>
<view class="grace-list">
<view class="grace-list-items">
<view class="grace-list-body">
<view class="grace-list-title">
<text class="grace-list-title-text">列表标题</text>
<view style="width:200rpx;">
<graceFaceGroup size="50" space="{{30}}" items="{{faces}}"></graceFaceGroup>
</view>
</view>
</view>
</view>
</view>
</view>
</gracePage>.json
{
"usingComponents": {
"gracePage": "../../graceUI/components/gracePage",
"graceFaceGroup": "../../graceUI/components/graceFaceGroup"
}
}.js
Page({
data: {
faces: [
'http://img4.imgtn.bdimg.com/it/u=552119130,3001255642&fm=26&gp=0.jpg',
'http://img2.imgtn.bdimg.com/it/u=3428383444,2828052422&fm=26&gp=0.jpg',
'http://img2.imgtn.bdimg.com/it/u=1972994033,181763631&fm=26&gp=0.jpg',
'http://img1.imgtn.bdimg.com/it/u=291222564,3369340489&fm=26&gp=0.jpg',
'http://img3.imgtn.bdimg.com/it/u=3904304279,448031564&fm=26&gp=0.jpg'
]
},
addBtnClicked: function () {
wx.showToast({
title: "您点击了按钮",
icon: "none"
});
// 请完善您的代码
}
});.wxss
.add-btn{text-align:center; line-height:80rpx; font-size:38rpx; background:#008CFF; color:#FFFFFF;}