frontend/examking-app/plugins/uview-ui/components/u-avatar-cropper/weCropper.js

(开头部分) 32KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/**
 * we-cropper v1.3.9
 * (c) 2020 dlhandsome
 * @license MIT
 */
(function(global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
		typeof define === 'function' && define.amd ? define(factory) :
		(global.WeCropper = factory());
}(this, (function() {
	'use strict';

	var device = void 0;
	var TOUCH_STATE = ['touchstarted', 'touchmoved', 'touchended'];

	function firstLetterUpper(str) {
		return str.charAt(0).toUpperCase() + str.slice(1)
	}

	function setTouchState(instance) {
		var arg = [],
			len = arguments.length - 1;
		while (len-- > 0) arg[len] = arguments[len + 1];

		TOUCH_STATE.forEach(function(key, i) {
			if (arg[i] !== undefined) {
				instance[key] = arg[i];
			}
		});
	}

	function validator(instance, o) {
		Object.defineProperties(instance, o);
	}

	function getDevice() {
		if (!device) {
			device = uni.getSystemInfoSync();
		}
		return device
	}

	var tmp = {};

	var ref = getDevice();
	var pixelRatio = ref.pixelRatio;

	var DEFAULT = {
		id: {
			default: 'cropper',
			get: function get() {
				return tmp.id
			},
			set: function set(value) {
				if (typeof(value) !== 'string') {
					console.error(("id:" + value + " is invalid"));
				}
				tmp.id = value;
			}
		},
后面还有 1205 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。