微信小程序:Error: Behaviors should be constructed with Behavior()

简介: 微信小程序:Error: Behaviors should be constructed with Behavior()

微信小程序:Error: Behaviors should be constructed with Behavior()


使用了微信小程序计算属性 computed

const computedBehavior = require('miniprogram-computed')

报错


Error: Behaviors should be constructed with Behavior()

原来是版本更新了,没有改文档,需要按照新的方式引用


const computedBehavior = require('miniprogram-computed').behavior

[有bug] 微信文档:https://developers.weixin.qq.com/miniprogram/dev/extended/utils/computed.html


[推荐] NPM文档:https://www.npmjs.com/package/miniprogram-computed

相关文章
|
4月前
|
小程序 JavaScript
【微信小程序】-- 自定义组件 - behaviors(三十九)
【微信小程序】-- 自定义组件 - behaviors(三十九)
|
4月前
|
小程序 前端开发 API
【微信小程序】TypeError: Cannot read property ‘get‘ of undefined & Error: MiniProgramError
【微信小程序】TypeError: Cannot read property ‘get‘ of undefined & Error: MiniProgramError
|
4月前
|
前端开发
命令行创建React项目
命令行创建React项目
命令行创建React项目
|
10月前
|
小程序
搞定 小程序 Behavior
搞定 小程序 Behavior
54 0
|
小程序 API
微信小程序-behaviors
什么是 behaviors • behaviors 是用于组件间代码共享的特性,类似于一些编程语言中的 “mixins” • 每个 behavior 可以包含一组属性,数据,生命周期函数和方法,组件引用它时,它的属性,数据和方法会被合并到组件中,生命周期函数也会在对应时机被调用。每个组件可以引用多个 behavior,behavior 也可以引用其它 behavior。
111 2
|
12月前
|
移动开发 小程序 Android开发
支付宝小程序IOS连接mqtt接收AMQJS0007E Socket error
支付宝小程序IOS连接mqtt接收AMQJS0007E Socket error
134 0
|
小程序 JavaScript
微信小程序开发入门与实战(Behaviors使用)
微信小程序开发入门与实战(Behaviors使用)
微信小程序开发入门与实战(Behaviors使用)
|
JSON 小程序 JavaScript
微信小程序--》小程序—组件通信和behavior使用
⚓经过web前端开发的学习,相信大家对于前端开发有了一定深入的了解,今天我开设了微信小程序,主要想从移动端开发方向进一步发展,而对于我来说写移动端博文的第一站就是小程序开发,希望看到我文章的朋友能对你有所帮助。
319 0
微信小程序--》小程序—组件通信和behavior使用
|
小程序
【微信小程序登录错误】"code":-1,"error":"ERR_GET_SESSION_KEY\n{\"code\":0,\"message\":\"\",\"codeDesc\":\"Succe
【微信小程序登录错误】"code":-1,"error":"ERR_GET_SESSION_KEY\n{\"code\":0,\"message\":\"\",\"codeDesc\":\"Succe
957 0
【微信小程序登录错误】"code":-1,"error":"ERR_GET_SESSION_KEY\n{\"code\":0,\"message\":\"\",\"codeDesc\":\"Succe
|
15天前
|
小程序 前端开发 Java
SpringBoot+uniapp+uview打造H5+小程序+APP入门学习的聊天小项目
JavaDog Chat v1.0.0 是一款基于 SpringBoot、MybatisPlus 和 uniapp 的简易聊天软件,兼容 H5、小程序和 APP,提供丰富的注释和简洁代码,适合初学者。主要功能包括登录注册、消息发送、好友管理及群组交流。
37 0
SpringBoot+uniapp+uview打造H5+小程序+APP入门学习的聊天小项目