update js
This commit is contained in:
@@ -70,6 +70,13 @@ export interface IView {
|
||||
/**----------transform----------*/
|
||||
}
|
||||
|
||||
export type NativeViewModel = {
|
||||
id: string;
|
||||
type: string;
|
||||
props: {
|
||||
[index: string]: Model;
|
||||
};
|
||||
}
|
||||
|
||||
export abstract class View implements Modeling, IView {
|
||||
@Property
|
||||
@@ -206,7 +213,7 @@ export abstract class View implements Modeling, IView {
|
||||
return this.__dirty_props__
|
||||
}
|
||||
|
||||
nativeViewModel = {
|
||||
nativeViewModel: NativeViewModel = {
|
||||
id: this.viewId,
|
||||
type: this.constructor.name,
|
||||
props: this.__dirty_props__,
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Stack } from './layouts'
|
||||
import { Property, IView, Superview, View } from '../ui/view'
|
||||
import { Property, IView, Superview, View, NativeViewModel } from '../ui/view'
|
||||
import { layoutConfig } from '../util/index.util'
|
||||
|
||||
export class FlowLayoutItem extends Stack {
|
||||
@@ -105,7 +105,7 @@ export class FlowLayout extends Superview implements IFlowLayout {
|
||||
})
|
||||
}
|
||||
|
||||
toModel() {
|
||||
toModel(): NativeViewModel {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { View, Property, Superview, IView } from "../ui/view";
|
||||
import { View, Property, Superview, IView, NativeViewModel } from "../ui/view";
|
||||
import { Stack } from "./layouts";
|
||||
import { layoutConfig, LayoutSpec } from "../util/layoutconfig";
|
||||
|
||||
@@ -93,7 +93,7 @@ export class List extends Superview implements IList {
|
||||
})
|
||||
}
|
||||
|
||||
toModel() {
|
||||
toModel(): NativeViewModel {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { View, Property, Superview, IView } from "../ui/view";
|
||||
import { View, Property, Superview, IView, NativeViewModel } from "../ui/view";
|
||||
import { List } from "./list";
|
||||
import { Scroller } from "./scroller";
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
@@ -43,7 +43,7 @@ export class Refreshable extends Superview implements IRefreshable {
|
||||
return this.nativeChannel(context, 'isRefreshing')() as Promise<boolean>
|
||||
}
|
||||
|
||||
toModel() {
|
||||
toModel(): NativeViewModel {
|
||||
this.dirtyProps.content = this.content.viewId
|
||||
this.dirtyProps.header = ((this.header || {}) as any).viewId
|
||||
return super.toModel()
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Superview, View, IView } from '../ui/view'
|
||||
import { Superview, View, IView, NativeViewModel } from '../ui/view'
|
||||
import { layoutConfig } from '../util/layoutconfig'
|
||||
|
||||
export function scroller(content: View) {
|
||||
@@ -34,7 +34,7 @@ export class Scroller extends Superview implements IScroller {
|
||||
return [this.content]
|
||||
}
|
||||
|
||||
toModel() {
|
||||
toModel(): NativeViewModel {
|
||||
this.dirtyProps.content = this.content.viewId
|
||||
return super.toModel()
|
||||
}
|
||||
|
Reference in New Issue
Block a user