更新记录

1.0.0(2024-12-04) 下载此版本

首次发布。


平台兼容性

Vue2 Vue3
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 3.1.0 app-vue app-nvue
钉钉小程序 快手小程序 飞书小程序 京东小程序
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari

cook-tools 是从 cook-uni 组件库抽离出来的一个工具库,本插件包含了开发中常用的js工具库和scss变量,以方便快速开发,避免重复造轮子。

使用方法

<script setup>
import { uid } from "@/uni_modules/cook-tools/index";

console.log(uid()) // czXkDVapvHCnLypp0xg32yOkabfV8nQY
</script>

工具列表

Mixin

  • styleMixin.js 在组件的props中混入cStylecClass,来替代和扩展styleclass,数据类型支持StringObjectArray

主题

theme.scss 文件中存放scss主题变量,使用如下:

uni.scss中全局引入。

// uni.scss
@import "@/uni_modules/cook-tools/theme.scss";

或在页面或组件中单独引入主题变量。

<style lang="scss">
  @import "@/uni_modules/cook-tools/theme.scss";

  .my-class {
    background-color: $cook-color-primary;
  }
</style>

全部的主题变量如下:

// 主题色
$cook-color-primary: #409eff !default;
$cook-color-success: #67c23a !default;
$cook-color-warning: #F7940C !default;
$cook-color-danger: #f56c6c !default;
$cook-color-info: #909399 !default;

// 常规色
$cook-color-black: #000000 !default;
$cook-color-white: #ffffff !default;
$cook-color-transparent: rgba($color: #000000, $alpha: 0) !default;

// 中性色
$cook-main-color: #303133 !default;
$cook-regular-color: #606062 !default;
$cook-secondary-color: #8f909 !default;
$cook-placeholder-color: #c1c1c2 !default;

// 背景色
$cook-bg-color-base: #f8f8f8 !default;
$cook-bg-color-dark: #f6f6f6 !default;
$cook-bg-color-darker: #f4f4f4 !default;
$cook-bg-color-light: #fafafa !default;
$cook-bg-color-lighter: #fcfcfc !default;

// 边框色
$cook-border-color: #dcdfe6 !default;
$cook-border-color-dark: #d4d7de !default;
$cook-border-color-darker: #cdd0d6 !default;
$cook-border-color-light: #e4e7ec !default;
$cook-border-color-lighter: #ebecf1 !default;

// 圆角
$cook-radius-sm: 6rpx !default;
$cook-radius-base: 10rpx !default;
$cook-radius-lg: 16rpx !default;

// 阴影
$cook-shadow-sm: 0 4rpx 6rpx rgba(0, 0, 0, 0.05) !default;
$cook-shadow-base: 0 6rpx 12rpx rgba(0, 0, 0, 0.05) !default;
$cook-shadow-lg: 0 12rpx 24rpx rgba(0, 0, 0, 0.05) !default;

Cook-uni

Cook uni是基于uni-app的多平台快速开发UI框架,历经多个大小型的项目实践,已形成一套更适合uni-app多平台开发的UI框架。

查看cook-uniUi组件库。

这些项目都使用了cook-uni:项目案例

功能预览:查看示例

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT License

Copyright (c) 2024 www.zhuyanjun.cn

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问