behaviors
这是好东西,意味着组件能mixin了,
那为啥不赶紧提供一个面向page的behaviors啊!!!!
这是好东西,意味着组件能mixin了,
那为啥不赶紧提供一个面向page的behaviors啊!!!!
多谢耐心解答
但是目前问题如下:
page直接用Component声明,
Component({ behaviors: [myBehavior], properties: { myProperty: { type: String } }, data: { myData: {} }, attached: function(){}, methods: { myMethod: function(){} }}) |
pages/fenxiao/stores/index.js 出现脚本错误或者未正确调用 Page()
(anonymous) @ appservice:15026
WAService.js:3 jsEnginScriptError
n is not a function
TypeError: n is not a function
at _ (http://127.0.0.1:9973/appservice/\_\_dev\_\_/WAService.js:12:14247)
at Function.y [as create] (http://127.0.0.1:9973/appservice/\_\_dev\_\_/WAService.js:12:14400)
at Function.p.prepare (http://127.0.0.1:9973/appservice/\_\_dev\_\_/WAService.js:11:12109)
at F (http://127.0.0.1:9973/appservice/\_\_dev\_\_/WAService.js:13:14230)
at W (http://127.0.0.1:9973/appservice/\_\_dev\_\_/WAService.js:13:14261)
at U (http://127.0.0.1:9973/appservice/\_\_dev\_\_/WAService.js:13:14641)
at Function.<anonymous> (http://127.0.0.1:9973/appservice/\_\_dev\_\_/WAService.js:13:17012)
at http://127.0.0.1:9973/appservice/\_\_dev\_\_/WAService.js:13:22046
at http://127.0.0.1:9973/appservice/\_\_dev\_\_/WAService.js:5:22487
at Array.forEach (<anonymous>)
Page[pages/fenxiao/stores/index] not found. May be caused by: 1. Forgot to add page route in app.json. 2. Invoking Page() in async task.
Q:我现在能用在实际项目不?
A:我们需要最后确定下,请关注近期的更新。你可以先用着。
Q:给个page用component声明的例子?
A:就像Component()那样用就可以了。
Q:Forgot to add page route in app.json
A:虽然你用的是Component(),但要记得把它加到app.json的pages列表中去。