mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-04-19 17:16:08 +08:00
3.0 KiB
3.0 KiB
类 MComponent
渲染进程类,游戏进程不能直接使用。对于部分方法,请参考 UI 编写
- 实例成员
- 实例方法
- 静态成员
- 静态方法
content
declare var content: any[]
-
成员说明
存储了当前组件的所有内容
defineProps()
declare function defineProps(props: Record<string, any>): this
defineEmits()
declare function defineEmits(emits: string[]): this
div()
declare function div(children?: any, config?: any): this
span()
declare function span(children?: any, config?: any): this
canvas()
declare function canvas(config?: any): this
text()
declare function text(text: string | (() => string), config?: any): this
com()
declare function com(component: any, config?: any): this
vfor()
declare function vfor(items: any, map: (value: any, index: number) => VNode): this
h()
declare function h(type: any, children?: any, config?: any): this
onSetup()
declare function onSetup(fn: OnSetupFunction): this
onMounted()
declare function onMounted(fn: OnMountedFunction): this
setup()
declare function setup(fn: SetupFunction): this
ret()
declare function ret(fn: RetFunction): this
export()
declare function export(): Component
mountNum
declare var mountNum: number
vNodeS()
declare function vNodeS(child: any, mount?: number): VNode
-
静态方法说明
将单个渲染内容输出为单个
VNode
vNodeM()
declare function vNodeM(mc: MComponent, mount?: number): VNode[]
-
静态方法说明
将一个
MComponent
组件渲染为一个VNode
数组
vNode()
declare function vNode(children: any, mount?: number): VNode[]
-
静态方法说明
将一系列渲染内容输出为一个
VNode
数组
unwrapProps()
declare function unwrapProps(props?: Record<string, () => any>): Record<string, any>
-
静态方法说明
获取 props 的真实值。因为传入渲染内容的 props 是一个函数,因此需要一层调用
prop()
declare function prop(component: Component, props: Record<string, any>): VNode
-
静态方法说明
在渲染时给一个组件传递 props。实际效果为在调用后并不会传递,当被传递的组件被渲染时,将会传递 props。