Code Monkey home page Code Monkey logo

cocos_creator_mvvm_tools's Issues

VMParent

需要在VMParent下动态添加VMBase节点,在VMBase指定watchPath后会报错。
路径不合法,可能错误覆盖了 VMParent 的onLoad 方法, 或者父节点并未挂载 VMParent 相关的组件脚本
但是预制的节点正常
应该怎样处理

setValue(path,object) Object 如果是個cc.Component 會出錯

把 Class 跟 cc.Component 會出現以下的錯誤

CCDebug.js:216 Uncaught RangeError: Maximum call stack size exceeded at JsonOb.overrideArrayProto (JsonOb.ts:98) at JsonOb.observe (JsonOb.ts:34) at JsonOb.<anonymous> (JsonOb.ts:64) at Array.forEach (<anonymous>) at JsonOb.observe (JsonOb.ts:37) at JsonOb.<anonymous> (JsonOb.ts:64) at Array.forEach (<anonymous>) at JsonOb.observe (JsonOb.ts:37) at JsonOb.<anonymous> (JsonOb.ts:64) at Array.forEach (<anonymous>)

文件 JsonOb.ts 里面的 'short' 字符是不是应该是'sort'

脚本文件 assets/Script/modelView/JsonOb.tsOAM定义里面的 short 是不是应该是 sort呀? OAM定义如下 :

const OAM = ['push', 'pop', 'shift', 'unshift', 'short', 'reverse', 'splice'];

我没记错的话,数组里面有个 sort 方法,没有 short 方法。

MVVM下有拖拽UI交互的怎么设计好

例如:

拖拽UI某个图标,到场景某个位置,在场景这个位置生成图标对应的建筑。

我目前设想处理:
1.增加拖拽的控件,实现拖拽中的表现
2.拖拽完后,实现通过modify去通知对应方法(带屏幕位置参数)去修改场景

範例 JSVMParentTest 裡 VMLable 取 VMParent 時會抱錯

在Creator 2.1.3 ,這範例VMLable 的 path *.name 執行時回出現兩個Error Log

  1. cant find VM from: *
    2.Cant get VM:*

但最後還是Lable 還是有顯示 VMParent 裡 data.name 得職值

猜想是不是腳本執行時間序的問題

bindPath只能指定到具体的字段吗?

我使用的VMParent来自己控制UI

VM.setValue("group.groupMyInfo.nextAdTime", 123)

如果这样变化数据, 那bindPath "group.groupMyInfo.nextAdTime” 就可以监听到数据变化。

但是如果:
VM.setValue("group.groupMyInfo", $groupMyInfo )
也就是直接设置一个json Object 那
bindPath "group.groupMyInfo” 就会监听不到变化。

请问为什么呢? 我应该如果解决

监听数值变化

却发现回调函数里取值是数值变化前的值? 变化前的数值没有什么意义。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.