@mpxjs/api-proxy
Advanced tools
Comparing version 2.8.61 to 2.8.63
{ | ||
"name": "@mpxjs/api-proxy", | ||
"version": "2.8.61", | ||
"version": "2.8.63", | ||
"description": "convert miniprogram API at each end", | ||
@@ -42,3 +42,3 @@ "module": "src/index.js", | ||
}, | ||
"gitHead": "f393ffc439f21b24f5f09a65ef99db20b145e19a" | ||
"gitHead": "c4c20d476f874c8d5b6f6b987e4748444a28b3c5" | ||
} |
@@ -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 () { |
125042
58
3285