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

如何为 route 块里添加的属性补充类型声明 #116

Open
aliuq opened this issue Nov 26, 2023 · 4 comments · May be fixed by #117
Open

如何为 route 块里添加的属性补充类型声明 #116

aliuq opened this issue Nov 26, 2023 · 4 comments · May be fixed by #117

Comments

@aliuq
Copy link

aliuq commented Nov 26, 2023

描述问题

我有一个新的需求,需要在 route 块中添加一个新的属性,来在钩子函数中进行处理,如何通过 volar 补充额外的类型声明

<route lang="json">
{
  "demo": true
}
</route>

复现

系统信息

System:
    OS: Windows 11 10.0.25997
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 8.96 GB / 39.70 GB
  Binaries:
    Node: 18.16.1 - C:\scoop_soft\apps\nvm\current\nodejs\nodejs\node.EXE
    Yarn: 3.6.1 - C:\scoop_soft\apps\nvm\current\nodejs\nodejs\yarn.CMD
    npm: 9.5.1 - C:\scoop_soft\apps\nvm\current\nodejs\nodejs\npm.CMD
    pnpm: 8.6.9 - C:\scoop_soft\apps\nvm\current\nodejs\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (121.0.2220.3)
    Internet Explorer: 11.0.25997.1000


volar.config.js

```js
const volarServiceUniPages = require('@uni-helper/volar-service-uni-pages')

module.exports = {
  services: [volarServiceUniPages()],
}


### 使用的包管理器

pnpm

### 核对

- [X] 遵循我们的 [行为准则](https://github.com/uni-helper/.github/blob/main/CODE_OF_CONDUCT.md)
- [X] 检查是否已经有一个报告相同错误的问题,以避免重复创建。
- [X] 这是一个具体的错误。请开启 GitHub 讨论你的疑问。
- [X] 所提供的复现是这个问题的 [最小复现](https://stackoverflow.com/help/minimal-reproducible-example)。
@KeJunMao
Copy link
Member

暂不支持,欢迎 PR~

@aliuq
Copy link
Author

aliuq commented Nov 26, 2023

volar 复杂了,我暂时还不太会 🤣

@aliuq aliuq linked a pull request Nov 26, 2023 that will close this issue
@KeJunMao KeJunMao linked a pull request Nov 27, 2023 that will close this issue
@leookun
Copy link

leookun commented Dec 19, 2023

@ModyQyW
Copy link
Member

ModyQyW commented Aug 28, 2024

由于 https://github.com/vuejs/language-tools/issues/4709,最新的 volar 不支持 route block 里面的智能提示,我们可能将要放弃 route block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants