feat:change makeRef to createRef

This commit is contained in:
pengfei.zhou 2021-09-03 16:48:24 +08:00 committed by osborn
parent c2b07e4a20
commit 4b66be7bc1
11 changed files with 20 additions and 23 deletions

View File

@ -17,7 +17,7 @@ import {
Scroller, Scroller,
jsx, jsx,
VLayout, VLayout,
makeRef, createRef,
HLayout, HLayout,
} from "doric"; } from "doric";
import { colors } from "./utils"; import { colors } from "./utils";
@ -216,11 +216,11 @@ interface GoBangState {
class GoBangVH extends ViewHolder { class GoBangVH extends ViewHolder {
root!: Group; root!: Group;
gap = 0; gap = 0;
currentRole = makeRef<Text>(); currentRole = createRef<Text>();
result = makeRef<Text>(); result = createRef<Text>();
targetZone: View[] = []; targetZone: View[] = [];
gameMode = makeRef<Text>(); gameMode = createRef<Text>();
assistant = makeRef<Text>(); assistant = createRef<Text>();
build(root: Group): void { build(root: Group): void {
this.root = root; this.root = root;
} }

View File

@ -6,10 +6,7 @@ import {
Group, Group,
layoutConfig, layoutConfig,
Text, Text,
makeRef, createRef,
Stack,
Color,
modal,
} from "doric"; } from "doric";
function createFragment() { function createFragment() {
@ -25,7 +22,7 @@ function createFragment() {
class Counter extends Panel { class Counter extends Panel {
build(root: Group) { build(root: Group) {
const fragments = createFragment(); const fragments = createFragment();
const ref = makeRef<Text>(); const ref = createRef<Text>();
let count = 0; let count = 0;
<VLayout <VLayout
space={20} space={20}

View File

@ -223,7 +223,7 @@ var Ref = /** @class */ (function () {
}); });
return Ref; return Ref;
}()); }());
function makeRef() { function createRef() {
return new Ref; return new Ref;
} }
var View = /** @class */ (function () { var View = /** @class */ (function () {
@ -4142,6 +4142,7 @@ exports.ViewHolder = ViewHolder;
exports.ViewModel = ViewModel; exports.ViewModel = ViewModel;
exports.animate = animate; exports.animate = animate;
exports.coordinator = coordinator; exports.coordinator = coordinator;
exports.createRef = createRef;
exports.draggable = draggable; exports.draggable = draggable;
exports.flexlayout = flexlayout; exports.flexlayout = flexlayout;
exports.flowItem = flowItem; exports.flowItem = flowItem;
@ -4158,7 +4159,6 @@ exports.listItem = listItem;
exports.log = log; exports.log = log;
exports.loge = loge; exports.loge = loge;
exports.logw = logw; exports.logw = logw;
exports.makeRef = makeRef;
exports.modal = modal; exports.modal = modal;
exports.navbar = navbar; exports.navbar = navbar;
exports.navigator = navigator; exports.navigator = navigator;

View File

@ -152,7 +152,7 @@ class Ref {
return this.view; return this.view;
} }
} }
function makeRef() { function createRef() {
return new Ref; return new Ref;
} }
class View { class View {
@ -3191,6 +3191,7 @@ exports.ViewHolder = ViewHolder;
exports.ViewModel = ViewModel; exports.ViewModel = ViewModel;
exports.animate = animate; exports.animate = animate;
exports.coordinator = coordinator; exports.coordinator = coordinator;
exports.createRef = createRef;
exports.draggable = draggable; exports.draggable = draggable;
exports.flexlayout = flexlayout; exports.flexlayout = flexlayout;
exports.flowItem = flowItem; exports.flowItem = flowItem;
@ -3207,7 +3208,6 @@ exports.listItem = listItem;
exports.log = log; exports.log = log;
exports.loge = loge; exports.loge = loge;
exports.logw = logw; exports.logw = logw;
exports.makeRef = makeRef;
exports.modal = modal; exports.modal = modal;
exports.navbar = navbar; exports.navbar = navbar;
exports.navigator = navigator; exports.navigator = navigator;

View File

@ -1676,7 +1676,7 @@ class Ref {
return this.view; return this.view;
} }
} }
function makeRef() { function createRef() {
return new Ref; return new Ref;
} }
class View { class View {
@ -4956,6 +4956,7 @@ exports.ViewHolder = ViewHolder;
exports.ViewModel = ViewModel; exports.ViewModel = ViewModel;
exports.animate = animate; exports.animate = animate;
exports.coordinator = coordinator; exports.coordinator = coordinator;
exports.createRef = createRef;
exports.draggable = draggable; exports.draggable = draggable;
exports.flexlayout = flexlayout; exports.flexlayout = flexlayout;
exports.flowItem = flowItem; exports.flowItem = flowItem;
@ -4972,7 +4973,6 @@ exports.listItem = listItem;
exports.log = log; exports.log = log;
exports.loge = loge; exports.loge = loge;
exports.logw = logw; exports.logw = logw;
exports.makeRef = makeRef;
exports.modal = modal; exports.modal = modal;
exports.navbar = navbar; exports.navbar = navbar;
exports.navigator = navigator; exports.navigator = navigator;

2
doric-js/index.d.ts vendored
View File

@ -195,7 +195,7 @@ declare module 'doric/lib/src/ui/view' {
set current(v: T); set current(v: T);
get current(): T; get current(): T;
} }
export function makeRef<T extends View>(): Ref<T>; export function createRef<T extends View>(): Ref<T>;
export abstract class View implements Modeling { export abstract class View implements Modeling {
width: number; width: number;
height: number; height: number;

View File

@ -19,7 +19,7 @@ export declare class Ref<T extends View> {
set current(v: T); set current(v: T);
get current(): T; get current(): T;
} }
export declare function makeRef<T extends View>(): Ref<T>; export declare function createRef<T extends View>(): Ref<T>;
export declare abstract class View implements Modeling { export declare abstract class View implements Modeling {
width: number; width: number;
height: number; height: number;

View File

@ -34,7 +34,7 @@ export class Ref {
return this.view; return this.view;
} }
} }
export function makeRef() { export function createRef() {
return new Ref; return new Ref;
} }
export class View { export class View {

View File

@ -80,7 +80,7 @@ export class Ref<T extends View> {
} }
} }
export function makeRef() { export function createRef() {
return new Ref return new Ref
} }

View File

@ -62,7 +62,7 @@ export class Ref<T extends View> {
} }
} }
export function makeRef<T extends View>(): Ref<T> { export function createRef<T extends View>(): Ref<T> {
return new Ref return new Ref
} }

View File

@ -1730,7 +1730,7 @@ class Ref {
return this.view; return this.view;
} }
} }
function makeRef() { function createRef() {
return new Ref; return new Ref;
} }
class View { class View {
@ -4769,6 +4769,7 @@ exports.ViewHolder = ViewHolder;
exports.ViewModel = ViewModel; exports.ViewModel = ViewModel;
exports.animate = animate; exports.animate = animate;
exports.coordinator = coordinator; exports.coordinator = coordinator;
exports.createRef = createRef;
exports.draggable = draggable; exports.draggable = draggable;
exports.flexlayout = flexlayout; exports.flexlayout = flexlayout;
exports.flowItem = flowItem; exports.flowItem = flowItem;
@ -4785,7 +4786,6 @@ exports.listItem = listItem;
exports.log = log; exports.log = log;
exports.loge = loge; exports.loge = loge;
exports.logw = logw; exports.logw = logw;
exports.makeRef = makeRef;
exports.modal = modal; exports.modal = modal;
exports.navbar = navbar; exports.navbar = navbar;
exports.navigator = navigator; exports.navigator = navigator;