当前位置 : 主页 > 网络编程 > JavaScript >

显示和合上更多内容

来源:互联网 收集:自由互联 发布时间:2021-06-28
gistfile1.txt carryOut: function(){//显示和合上更多内容 var that = this; var content = that.data.content; if (that.data.isOpen == false){ content.ignature = ignatureText; that.setData({ content, isOpen:true, openText: "合上", })
gistfile1.txt
carryOut: function(){//显示和合上更多内容
    var that = this;
    var content = that.data.content;
    if (that.data.isOpen == false){
      content.ignature = ignatureText;
      that.setData({
        content,
        isOpen:true,
        openText: "合上",        
      })
    }
    else if(that.data.isOpen == true){
      content.ignature = ignatureText.substr(0, 64) + "...";
      that.setData({
        content,
        isOpen: false,
        openText: "展开",
      })
    }
  },
网友评论