提交 84e010bd 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

wip(uts): automator element.data path

上级 b8ee405d
......@@ -347,7 +347,6 @@ export const getData = (params: GetDataParams, callback: Callback): void => {
if (component != null) {
const data = componentGetData(
component,
params.path != null ? params.path : ''
)
callback({ data }, null)
}
......
......@@ -13,7 +13,7 @@ export const getData = (params: GetDataParams, callback: Callback): void => {
callback(null, { errMsg: 'Page.getData:fail, Page not found.' })
return
}
const data = pageGetData(page, params.path)
const data = pageGetData(page)
callback({ data }, null)
}
......
......@@ -32,7 +32,6 @@ export function getPageVm(id: string): BasePage | null {
export function pageGetData(
// @ts-ignore
vm: BasePage,
path?: string
): Map<string, any | null> {
// TODO: path 目前无法处理类型问题,暂由服务端处理
return vm.$data
......@@ -286,16 +285,9 @@ function isValidNode(node: INode, selector: string): boolean {
export function componentGetData(
// @ts-ignore
vm: ComponentPublicInstance,
path?: string
): Map<string, any | null> {
let data = new Map<string, any | null>()
// TODO: path
if (path != null && path.length != 0) {
data.set('errMsg', `getData:fail, path:${path} is not supported.`)
} else {
data = vm.$data
}
return data
// TODO: path 目前无法处理类型问题,暂由服务端处理
return vm.$data
}
export function componentSetData(
// @ts-ignore
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册