# simple-toast **Repository Path**: mdaovo/simple-toast ## Basic Information - **Project Name**: simple-toast - **Description**: 简单的toast插件 - **Primary Language**: JavaScript - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2019-08-07 - **Last Updated**: 2020-12-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # simple-toast 简单的toast,目前还不支持手机,使用的CSS3,部分浏览器有兼容性问题 # 使用 ```` ```` 你可以像下面这样使用 ```` st({ text:"hello", icon:"loading", title:"Beautiful!", imgUrl:"http://images.shejidaren.com/wp-content/uploads/2019/07/20190731-18.jpg" }) // and use ts.hide(during) to hide the toast st.hide(1500) ```` ##### 例子: ![avatar](./examples/example1.png) ### 配置参数 - #### text ##### (Type: string,Default:"") ##### Description:the toast's text ##### Examples ```` st({text:"hello"}) ```` ![avatar](./examples/example2.png) - #### title ##### Type: string,Default:"" ##### Description:the toast's title ##### Examples ```` st({title:"Beautiful!"}) ```` ![avatar](./examples/example3.png) - #### icon ##### Type: string ##### Description:the toast's icon,now it's just have one icon 'loading' ##### Examples ```` st({icon:"loading"}) ```` ![avatar](./examples/example4.png) - #### imgUrl ##### Type: string ##### Description:the toast's can append a img ##### Examples ```` st({imgUrl:"http://images.shejidaren.com/wp-content/uploads/2019/07/20190731-18.jpg"}) ```` ![avatar](./examples/example5.png) ### 方法 - #### hide ##### params: (during: number) ##### Description:close the toast,and the during is ms ```` st.hide(during) ````