# uni-fav ## Instructions 组件名:uni-fav 代码块: uFav 点击下载&安装 ### Syntax - 使用 ``(或 ``,当需要包裹子节点时)。 - 遇到平台差异时,建议使用条件编译(`#ifdef / #endif`)显式处理。 #### Properties | 属性名 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | star | Boolean | true | 按钮是否带星星 | | bgColor | String | #eeeeee | 未收藏时的背景色 | | bgColorChecked | String | #007aff | 已收藏时的背景色 | | fgColor | String | #666666 | 未收藏时的文字颜色 | | fgColorChecked | String | #FFFFFF | 已收藏时的文字颜色 | | circle | Boolean | false | 是否为圆角 | | checked | Boolean | false | 是否为已收藏 | | contentText | Object | {contentDefault: '收藏',contentFav: '已收藏'} | 收藏按钮文字 | #### Events | 事件称名 | 说明 | 返回值 | | --- | --- | --- | | click | 点击 fav按钮 触发事件 | - | #### Platform Compatibility See official docs for platform support table: `https://uniapp.dcloud.net.cn/component/uniui/uni-fav.html` ### Examples ### Example (Example 1) ```vue ``` ### Example (Example 2) ```html ``` ### Example (Example 3) ```vue ``` ### Example (Example 4) ```html ``` ### Example (Example 5) ```html ``` ### Example (Example 6) ```html ``` Reference: - [Official Documentation](https://uniapp.dcloud.net.cn/component/uniui/uni-fav.html) - [Plugin Marketplace](https://ext.dcloud.net.cn/plugin?name=fav) - [Local Example](examples/uni-ui/uni-fav.vue)