{
    "name": "gov-text-collapse",
    "label": "文本折行",
    "description": "文本折行组件",
    "codeSnap": "<gov-text-collapse text='文字很长,超出3行' line='{{3}}'></gov-text-collapse>",
    "groups": "layout",
    "demoCode": {
        "s": "<view class=\"preview-caption\">5行折叠</view>\n<view class=\"preview-section\">\n    <gov-text-collapse text=\"{{text}}\"></gov-text-collapse>\n</view>\n\n<view class=\"preview-caption\">3行折叠</view>\n<view class=\"preview-section\">\n    <gov-text-collapse text=\"{{text}}\" line=\"{{3}}\"></gov-text-collapse>\n</view>\n\n<view class=\"preview-caption\">iphone8p刚好5行</view>\n<view class=\"preview-section\">\n    <gov-text-collapse text=\"{{suteIn8p}}\"></gov-text-collapse>\n</view>\n\n<view class=\"preview-caption\">自定义颜色</view>\n<view class=\"preview-section\">\n    <gov-text-collapse\n        class=\"custom-color\"\n        gov-text-collapse-container=\"collapse-style\"\n        gov-text-collapse-content=\"gov-text-style\"\n        text=\"{{text}}\"\n    ></gov-text-collapse>\n</view>\n\n<view class=\"preview-caption\">自定义字体大小54px、间距21px</view>\n<view class=\"preview-section\">\n    <gov-text-collapse\n        class=\"custom-font\"\n        gov-text-collapse-container=\"collapse-style\"\n        gov-text-collapse-content=\"gov-text-style\"\n        text=\"{{bigFontSize}}\"\n    ></gov-text-collapse>\n</view>\n\n<view class=\"preview-caption\">异步 {{countDown}}s : 数据8p刚好5行</view>\n<view class=\"preview-section\">\n    <gov-text-collapse\n        class=\"custom-font\"\n        gov-text-collapse-container=\"collapse-style\"\n        gov-text-collapse-content=\"gov-text-style\"\n        text=\"{{asyncText}}\"\n    ></gov-text-collapse>\n</view>\n\n<view class=\"preview-caption\">保持段落格式&初始展开</view>\n<view class=\"preview-section\">\n    <gov-text-collapse\n        class=\"keep-line-style\"\n        gov-text-collapse-content=\"collapse-text-style\"\n        text=\"{{textPreline}}\"\n        expand={{true}}\n    ></gov-text-collapse>\n</view>\n\n<view class=\"preview-caption\">自定义按钮样式</view>\n<view class=\"preview-section\">\n    <gov-text-collapse\n        class=\"custom-btn-style\"\n        gov-text-collapse-btn=\"collapse-btn-style\"\n        text=\"{{text}}\"\n    ></gov-text-collapse>\n</view>",
        "js": "Page({\n    data: {\n        text: 'dest() 可以用在管道（pipeline）中间用于将文件的中间状态写入文件系统。'\n            + '当接收到一个文件时，当前状态的文件将被写入文件系统，文件路径也将被修改以反映输出文件的新位置，然后该文件继续沿着管道（pipeline）传输。'\n            + '此功能可用于在同一个管道（pipeline）中创建未压缩（unminified）和已压缩（minified）的文件。',\n\n        suteIn8p: 'dest() 可以用在管道（pipeline）中间用于将文件的中间状态写入文件系统。'\n            + '当接收到一个文件时，当前状态的文件将被写入文件系统，文件路径也将被修改以反映输出文件的新位置，然后该文件继续沿着管道（pipeline）传输。'\n            + '此功能可用于在同一个管道（pipeline',\n\n        bigFontSize: 'dest() 可以用在管道（pipeline）中间用于将文件的中间状态写入文件系统。'\n        + '当接收到一个文件时，当前状态的文件将被写入文件系统，文件路径也将被修改以反映输出文件的新位置，然后该文件继续沿着管道（pipeline）传输。'\n        + '此功能可用于在同一个管道（pipeline',\n\n        bigFontSizeSute8p: 'dest() 可以用在管道（pipeline）中间用于将文件的中间状态写入文件系统。'\n        + '当接收到一个文件时，当前状态的文件将被写入文件系统，文件路径也将被修改以反映输出文件的新位置，然后该文件继续沿着管道（pipeline）传输。'\n        + '此功能可',\n\n        textPreline: 'dest() 可以用在管道（pipeline）\n中间用于将文件的中间状态写入文件系统。'\n        + '\n当接收到一个文件时，当前状态的文件将被写入文件系统，文件路径也将被修改以反映输出文件的新位置，然后该文件继续沿着管道（pipeline）传输。'\n        + '\n此功能可用于在同一个管道（pipeline）中创建未压缩（unminified）和已压缩（minified）的文件。',\n\n        asyncText: '',\n\n        countDown: 5\n    },\n\n    onLoad() {\n        this.setData({\n            asyncText: this.data.bigFontSize\n        });\n\n        const timer = setInterval(() => {\n            this.setData({\n                countDown: this.data.countDown - 1\n            });\n\n            if (this.data.countDown === 0) {\n                this.setData({\n                    asyncText: this.data.bigFontSizeSute8p\n                });\n                clearInterval(timer);\n            }\n        }, 1000);\n    }\n});",
        "css": ".dot {\n    position: relative;\n    top: -6px;\n    height: 6px;\n    width: 6px;\n    border-radius: 50%;\n    background-color: #e34;\n}\n\n.content {\n    padding: 30.797rpx;\n}"
    },
    "fragement": "",
    "properties": {
        "attributes": [
            {
                "name": "text",
                "type": "String",
                "description": "文本内容",
                "required": "是",
                "default": ""
            },
            {
                "name": "line",
                "type": "Number",
                "description": "超出该值省略",
                "required": "否",
                "default": "5"
            },
            {
                "name": "showBtn",
                "type": "Boolean",
                "description": "是否展示收起、展开按钮",
                "required": "否",
                "default": "true"
            },
            {
                "name": "btnText",
                "type": "string[]",
                "description": "按钮文字",
                "required": "否",
                "default": "['展开', '收起']"
            },
            {
                "name": "selectable",
                "type": "Boolean",
                "description": "文本内容是否可选择 * <text>标签内置方便拿computedStyle",
                "required": "否",
                "default": "是"
            },
            {
                "name": "expand",
                "type": "Boolean",
                "description": "是否展开,例如初始展示展开状态",
                "required": "否",
                "default": "false"
            }
        ]
    }
}