2 Star 13 Fork 3

lesscode.work/Grace Animation Library

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
praise.vue 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
lesscode.work 提交于 4年前 . 20210413
<template>
<view class="gal-body">
<view style="margin-top:50rpx;">
<text class="gal-block-text gal-h4 gal-color-gray">点赞按钮演示</text>
</view>
<view class="gal-margin-top-large">
<view class="praise-button">
<gal-praise-button
ref="praiseButton"
@tapme="tapme"
:number="number"></gal-praise-button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
// 点赞数量
number : 99
}
},
methods: {
tapme : function(){
// 判断是否已经赞过
if(this.$refs.praiseButton.status != 1){
if(this.$refs.praiseButton.status == 4){
uni.showToast({
title:"已经赞过了", icon:"none"
});
}
return ;
}
// 图标动画 ( 代表与后端交互加载动画 )
this.$refs.praiseButton.loading();
// 与后端交互完成展示结果动画
setTimeout(()=>{
this.number = 100;
this.$refs.praiseButton.stopLoading();
}, 3000);
}
}
}
</script>
<style>
.praise-button{width:200rpx; margin-left:235rpx;}
</style>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/less_code/grace-animation-library.git
git@gitee.com:less_code/grace-animation-library.git
less_code
grace-animation-library
Grace Animation Library
master

搜索帮助