WeChat applet cloud development--database usage

1. For the steps of using WeChat cloud development, please refer to the corresponding content of the WeChat development document, pay attention to register APPID and check the cloud development option.
https://developers.weixin.qq.com/miniprogram/dev/wxcloud/quick-start/miniprogram.html
2. If you forget to check the cloud development option, you can refer to [Mini Program · Cloud Development] to manually change the mini program project into Cloud development projects.
Original link: https://blog.csdn.net/qq_30932479/article/details/109596946
3. To install npm, please refer to the Van Weapp document, https://youzan.github.io/vant-weapp/#/quickstart, for direct operation That's it.
Note that the fourth step is always to build npm. Currently, the "use npm" option cannot be found in the local settings.
4. For the use of the database, refer to the WeChat development documentation, and pay attention to the initialization:

const db = wx.cloud.database()
const todos = db.collection('todos')

5. Call the card and cloud database in npm to build a simple product display page
insert image description here

Guess you like

Origin blog.csdn.net/weixin_42370166/article/details/125098587