You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1005 B
JavaScript

2 years ago
// pages/test/index.js
Page({
/**
* 页面的初始数据
*/
data: {
questList: [{
questions: 'Q这是问题',
answers: "A答案内答案内容答案内容答案内容答案内容答案内容答案内容容容答案内容容容答案内容容",
t:false,
}, {
questions: 'Q这是问题',
answers: "A答案内答案内容答案内容答案内容答案内容答案内容答案内容容容答案内容容容答案内容容",
t:false,
}, {
questions: 'Q这是问题',
answers: "A答案内答案内容答案内容答案内容答案内容答案内容答案内容容容答案内容容容答案内容容",
t:false,
}],
},
// 折叠面板
panel: function (e) {
this.data.questList.forEach(item =>{
item.t = false
})
this.data.questList[e.currentTarget.dataset.index].t = !this.data.questList[e.currentTarget.dataset.index].t
this.setData({
questList:this.data.questList
})
},
})