Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@mand-mobile/platform-runtime
Advanced tools
Runtime shims and compiletime plugins for smoothing out differences between platforms.
import TransitionPrimitive from '@mand-mobile/platform-runtime/lib/component/transition'
false
import ScrollViewPrimitive from '@mand-mobile/platform-runtime/lib/component/scroll-view'
false
true
'auto'
false
0
import toastFactory from '@mand-mobile/platform-runtime/lib/component/toast'
import dialogFactory from '@mand-mobile/platform-runtime/lib/component/dialog'
import actionSheetFactory from '@mand-mobile/platform-runtime/lib/component/action-sheet'
import {Dom} from '@mand-mobile/platform-runtime/lib/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-runtime/lib/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-runtime 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.