接口: SetupContext<D, C, M, P>
定义于: packages/wevu/src/runtime/types/props.ts:114
类型参数
D
D extends object
C
C extends ComputedDefinitions
M
M extends MethodDefinitions
P
P extends ComponentPropsOptions = ComponentPropsOptions
属性
attrs
attrs:
Record<string,any>
定义于: packages/wevu/src/runtime/types/props.ts:171
Vue 3 对齐:attrs(小程序场景兜底为空对象)
bindModel()
bindModel: <
T>(path,options?) =>ModelBinding<T>
定义于: packages/wevu/src/runtime/types/props.ts:143
双向绑定辅助方法
类型参数
T
T = any
参数
path
string
options?
ModelBindingOptions<T, string, string, T>
返回
ModelBinding<T>
emit()
emit: (
event,detail?,options?) =>void
定义于: packages/wevu/src/runtime/types/props.ts:161
通过小程序 triggerEvent(eventName, detail?, options?) 派发事件。
注意:不同于 Vue 3 的 emit(event, ...args),小程序事件只携带一个 detail 载荷; options 用于控制事件传播行为(bubbles/composed/capturePhase)。
参数
event
string
detail?
any
options?
TriggerEventOption
返回
void
expose()
expose: (
exposed) =>void
定义于: packages/wevu/src/runtime/types/props.ts:166
Vue 3 对齐:expose 公共属性
参数
exposed
Record<string, any>
返回
void
instance
instance:
InternalRuntimeState
定义于: packages/wevu/src/runtime/types/props.ts:153
小程序内部实例
props
props:
InferProps<P>
定义于: packages/wevu/src/runtime/types/props.ts:123
组件 props(来自小程序 properties)
proxy
proxy:
ComponentPublicInstance<D,C,M>
定义于: packages/wevu/src/runtime/types/props.ts:138
公开实例代理
runtime
runtime:
RuntimeInstance<D,C,M>
定义于: packages/wevu/src/runtime/types/props.ts:128
运行时实例
slots
slots:
Record<string,any>
定义于: packages/wevu/src/runtime/types/props.ts:176
Vue 3 对齐:slots(小程序场景兜底为空对象)
state
state:
D
定义于: packages/wevu/src/runtime/types/props.ts:133
响应式状态
watch()
watch: <
T>(source,cb,options?) =>WatchStopHandle
定义于: packages/wevu/src/runtime/types/props.ts:148
watch 辅助方法
类型参数
T
T
参数
source
Record<string, any> | () => T
cb
(value, oldValue) => void