wsssheep / cocos_creator_mvvm_tools Goto Github PK
View Code? Open in Web Editor NEW适用于cocos creator 的 mvvm 的工具 集,摆脱传统设置节点属性来控制 UI 的方式
License: MIT License
适用于cocos creator 的 mvvm 的工具 集,摆脱传统设置节点属性来控制 UI 的方式
License: MIT License
却发现回调函数里取值是数值变化前的值? 变化前的数值没有什么意义。
我使用的VMParent来自己控制UI
VM.setValue("group.groupMyInfo.nextAdTime", 123)
如果这样变化数据, 那bindPath "group.groupMyInfo.nextAdTime” 就可以监听到数据变化。
但是如果:
VM.setValue("group.groupMyInfo", $groupMyInfo )
也就是直接设置一个json Object 那
bindPath "group.groupMyInfo” 就会监听不到变化。
请问为什么呢? 我应该如果解决
例如:
拖拽UI某个图标,到场景某个位置,在场景这个位置生成图标对应的建筑。
我目前设想处理:
1.增加拖拽的控件,实现拖拽中的表现
2.拖拽完后,实现通过modify去通知对应方法(带屏幕位置参数)去修改场景
把 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>)
不是应该是恢复本来的颜色么?
需要在VMParent下动态添加VMBase节点,在VMBase指定watchPath后会报错。
路径不合法,可能错误覆盖了 VMParent 的onLoad 方法, 或者父节点并未挂载 VMParent 相关的组件脚本
但是预制的节点正常
应该怎样处理
脚本文件 assets/Script/modelView/JsonOb.ts
的 OAM
定义里面的 short
是不是应该是 sort
呀? OAM定义如下 :
const OAM = ['push', 'pop', 'shift', 'unshift', 'short', 'reverse', 'splice'];
我没记错的话,数组里面有个 sort
方法,没有 short
方法。
一直期待着
在Creator 2.1.3 ,這範例VMLable 的 path *.name 執行時回出現兩個Error Log
但最後還是Lable 還是有顯示 VMParent 裡 data.name 得職值
猜想是不是腳本執行時間序的問題
rt
旧版本2.09没问题,麻烦看看是不是有什么兼容问题。
新建的label带templatemode的,重新打开场景或者编辑下代码刷新同样也会丢失。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.