themes/index/follow/index.js
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
var App = new Vue({
el: "#App",
data: function() {
return {
list: [],
tab: "follow"
}
},
created: function() {
this.getFollow();
},
methods: {
getFollow: function() {
var that = this;
$.ajax({
url: "/index.php?m=follow&ajax=1",
dataType: "json",
success: function(res) {
that.list = res.data.list;
}
})
},
getFollowed: function() {
var that = this;
$.ajax({
url: "/index.php?m=follow&a=followed&ajax=1",
dataType: "json",
success: function(res) {
that.list = res.data.list;
}
})
},
setTab: function(t) {
this.tab = t;
if (t == 'follow') {
this.getFollow();
} else {
this.getFollowed();
}
},
followToggle: function(item) {
var that = this;
switch (that.tab) {
case "follow":
if (confirm("确认取消关注吗?")) {
$.ajax({
url: "/index.php?m=follow&a=Toggle&ajax=1",
dataType: "json",
data: {
t_userid: item.userid
},
success: function(res) {
var nlist = Array();
for (var i in that.list) {
if (that.list[i].userid != item.userid) {
nlist.push(that.list[i]);
}
}
that.list = nlist;
}
后面还有 25 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。