Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@mand-mobile/platform
Advanced tools
@mand-mobile/platform
Runtime shims and compiletime plugins for smoothing out differences between platforms.
import TransitionPrimitive from '@mand-mobile/platform/lib/runtime/component/transition'
false
import ScrollViewPrimitive from '@mand-mobile/platform/lib/runtime/component/scroll-view'
false
true
'auto'
false
0
import toastFactory from '@mand-mobile/platform/lib/runtime/component/toast'
import dialogFactory from '@mand-mobile/platform/lib/runtime/component/dialog'
import actionSheetFactory from '@mand-mobile/platform/lib/runtime/component/action-sheet'
import {Dom} from '@mand-mobile/platform/lib/runtime/module'
const $MDDom = Dom.bind(this) // scoped selector like refs
$MDDom().querySelector('xxxx').getScrollOffset()
documentElement(): nodeRef
uniapp返回的是可视区域实例 查看详情
$MDDom().documentElement()
querySelector(elNmae: string): nodeRef
export default {
async mounted () {
const testNodeRef = this.$MDDom().querySelector('.test')
const rect: DOMRect = await testNodeRef.getBoundingClientRect()
}
}
querySelectorAll(elNmae: string): nodeRef
uniapp中返回的不是真实数组,所以不能直接用length等属性,需调用getNode方法
export default {
async mounted () {
const firsttTestNodeRef = this.$MDDom().querySelector('.test')[0]
const rect: DOMRect = await firsttTestNodeRef.getBoundingClientRect()
}
}
getNode(): Promise<any[]>
web中不做处理直接返回dom节点,uniapp支持Canvas节点的获取 查看详情
const nodeRefs = $MDDom().querySelectorAll('.test')
const nodes = await nodeRefs.getNode()
console.log(nodes) // [node, node, ...]
const nodeRef = $MDDom().querySelector('.test')
const node = await nodeRefs.getNode()
console.log(node)
getAttribute(prop: string): Promise<any>
uniapp中只能查询id或者nodesRef.fields方法中properties中可查询属性
export default {
async mounted () {
await $MDDom().querySelector('.test').getAttribute('id')
}
}
getBoundingClientRect(): Promise<DOMRect>
export default {
async mounted () {
await $MDDom().querySelector('.test').getBoundingClientRect()
}
}
getScrollOffset(): Promise<{scrollLeft: number, scrollTop: number }>
export default {
async mounted () {
await $MDDom().querySelector('.test').getScrollOffset()
}
}
getComputedStyle(propList: Array<string>): Promise<object>
export default {
async mounted () {
await $MDDom().querySelector('.test').getComputedStyle(['position'])
}
}
import {Device} from '@mand-mobile/platform/lib/runtime/module'
const device = Device()
device.vibrate()
or
export default {
mounted () {
$MDDevice().vibrate()
}
}
短时震动,仅在小程序真机有效,web和小程序调试工具无效
FAQs
mand-mobile runtime cross platform plugins
We found that @mand-mobile/platform demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.