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.
|
|
|
|
|
// 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
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
})
|