GithubHelp home page GithubHelp logo

Comments (4)

yuzhanglong avatar yuzhanglong commented on May 30, 2024 2

好,谢谢~ 然后还有个问题,刚刚发现进入开发环境时项目报错了,显示

TypeError: categoryOptions.forEach is not a function
  21 |   const list = []
  22 |   console.log(categoryOptions)
> 23 |   categoryOptions.forEach(c => {
     |                  ^
  24 |     const count = categoryObj[c.value]
  25 |     if (count) {
  26 |       list.push({ id: c.id, name: c.value, color: c.color, count })
error - lib/notion/getAllCategories.js (23:18) @ getAllCategories

categoryOptions.forEach(c => {
这个地方,categoryOptions 应该是个 Object。

from notionnext.

tangly1024 avatar tangly1024 commented on May 30, 2024 1

我也遇到过这个问题,也许你可以尝试一下我的解决方法:
首先:notionnext绑定的这个notion页面我们称之为博客列表

1.我的 博客列表主要用来定义排序、以及文章的模板格式。
2. 另外,我在notion中建了一个链接视图(notion的linked database),链接视图允许用户引用一个源数据,在视图中进行分组、分类、排序、筛选等操作,重要的是这不会修改到原数据本身的排序😄
3. 创建链接试图的方法很简单:复制博客列表的页面地址,在其它博客列表页面中粘贴,在粘贴时弹出的菜单中选择’linked todatabase’
44714A76-DFE2-4995-81AC-4519026D3D7C

from notionnext.

tangly1024 avatar tangly1024 commented on May 30, 2024

感谢你的反馈!😁

categoryOptions 取的是notion中的所有文章分类。它的期望值应该是一个对象数组[Obejct...],这里出现forEach函数错误显然不是我所预想的。

我在自己的开发环境中并没有出现该问题,原因是此异常仅在获取分类列表失败或为空时才会抛出,我将尽快修复这个bug。

from notionnext.

tangly1024 avatar tangly1024 commented on May 30, 2024

在最新的提交中已修复该问题 3030423

from notionnext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.