@mpxjs/api-proxy
Advanced tools
Comparing version 2.9.0-beta.5 to 2.9.0
{ | ||
"name": "@mpxjs/api-proxy", | ||
"version": "2.9.0-beta.5", | ||
"version": "2.9.0", | ||
"description": "convert miniprogram API at each end", | ||
@@ -42,3 +42,3 @@ "module": "src/index.js", | ||
}, | ||
"gitHead": "874e5d0915a28d527091090ff64ad2d182e43525" | ||
"gitHead": "91ac258dbf1d0a324a74cac606e2cc10ef557823" | ||
} |
@@ -18,6 +18,22 @@ function webHandleSuccess (result, success, complete) { | ||
/** | ||
* Creates a new DOM element with the specified tag, attributes, and children. | ||
* | ||
* @param {string} tag - The tag name of the new element. | ||
* @param {Object.<string, string>} [attrs={}] - An object containing the attributes to set on the new element. | ||
* @param {Array.<HTMLElement>} [children=[]] - An array of child elements to append to the new element. | ||
* @returns {HTMLElement} The newly created DOM element. | ||
*/ | ||
function createDom (tag, attrs = {}, children = []) { | ||
const dom = document.createElement(tag) | ||
Object.keys(attrs).forEach(k => dom.setAttribute(k, attrs[k])) | ||
children.length && children.forEach(child => dom.appendChild(child)) | ||
return dom | ||
} | ||
export { | ||
webHandleSuccess, | ||
webHandleFail, | ||
createDom, | ||
isTabBarPage | ||
} |
@@ -13,2 +13,5 @@ // base64ToArrayBuffer, arrayBufferToBase64 | ||
// previewImage | ||
export * from './preview-image' | ||
// showModal | ||
@@ -15,0 +18,0 @@ export * from './modal' |
@@ -1,12 +0,5 @@ | ||
import { webHandleSuccess } from '../../../common/js' | ||
import { webHandleSuccess, createDom } from '../../../common/js' | ||
import '../../../common/stylus/Toast.styl' | ||
import '../../../common/stylus/Loading.styl' | ||
function createDom (tag, attrs = {}, children = []) { | ||
const dom = document.createElement(tag) | ||
Object.keys(attrs).forEach(k => dom.setAttribute(k, attrs[k])) | ||
children.length && children.forEach(child => dom.appendChild(child)) | ||
return dom | ||
} | ||
export default class Toast { | ||
@@ -13,0 +6,0 @@ constructor () { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
130150
58
3442
0