[WeChat Mini Programs] the parameters passed by navigateTo cannot be used to call the backend API.

Page({
  //apps
  onLoad: function (options) {

    this.setData({
      articleId: options.article_id
    })

    let contentGroupID = 000000000000000
    let MyContentGroup = new wx.BaaS.ContentGroup(contentGroupID)
    
    MyContentGroup.getContent(articleId).then(res => {
      // success
      console.log(res.data)
    }, err => {
      // err
    })
  },
  //
  data: {

  }
})

error report:

thirdScriptError
articleId is not defined;at pages/apps/articles/articles page lifeCycleMethod onLoad function
ReferenceError: articleId is not defined

in fact, I have successfully obtained this articleId and can display it on the page. However, I now hope to use this number to check the content of this article, because this is the id of this article.

I don"t know what this is all about. Please take a look at it. Thank you!


cannot be used directly: articleId
but should go like this: this.data.articleId

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b317b5-2bda4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b317b5-2bda4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?