Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: 代码中的title被错误地渲染到侧边栏的目录中 #1999

Closed
zhangfisher opened this issue Jan 4, 2024 · 1 comment
Closed
Labels
invalid This doesn't seem right

Comments

@zhangfisher
Copy link

Version

2.2.16

OS Version

windows 10

Node.js Version

18

Browser Version

chrome 120

Link to minimal reproduction

https://github.com/zhangfisher/speed-form/docs

Steps to reproduce

我的文档工程

为代码声明了titledescription,但是title被渲染到侧边栏的目录中了。

/**
* title: 读取状态
* description: 通过`store.state.firstName`直接读取状态,不通过`useState`方法
*/
import { createStore } from 'helux-store';
const state = {
  firstName:"Zhang",
  lastName:"Fisher",
  age:18
}

const store = createStore<typeof state>({state})

export default () => {
  return <div>
      <div>Hello :{store.state.firstName}{' '}{store.state.lastName}</div>
      <div>Age :{store.state.age}</div>
      <button onClick={()=>setState(draft=>draft.age+=1)}>+Age</button>
    </div>
}

image

What is expected?

代码中的title不应该作为目录出现

What is actually happening?

代码中的title不应该作为目录出现

Any additional comments? (optional)

No response

@PeachScript
Copy link
Member

非 bug,侧边菜单子级展示的是当前页面的 TOC,demo 标题也是 TOC 的一部分

不想展示 demo 标题可以把 demo tocDepth 改深一级即可:https://d.umijs.org/config/markdown#tocdepth

@PeachScript PeachScript closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2024
@PeachScript PeachScript added invalid This doesn't seem right and removed unconfirmed labels Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants