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.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
// 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
} )
} ,
} )