didi / didi/mpx

[Bug report] 调试模式下模板代码无法获取定义的变量值

Open
#2,578 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.9k
Forks
392
Avg merge
3d 12h
Merged PRs (30d)
15

Description

**问题描述(只影响监听模式,编译模式不受影响)**

mpx 相关包都是最新版,应该和 2579 是同一个问题,setup() 函数中定义一个变量:
```
const state = reactive({
login: { loading: true },
loginBg: loginBg
});
```

模板中引用变量:
```

login.loading:{{ login.loading }}

```

loginBg 和 login.loading 都会因为无值而无法显示。

通过在package.json 中指定版本号:
"overrides": {
"webpack": "5.101.3"
},
可以临时解决,webpack版本号改为 "5.110.3",问题必现。

**体验问题:跟上面 bug 无关,不确定反馈到哪个仓库**

1、插件用的是 Mpx (Official) 最新版,VSCode中打开 app.mpx 页面,不支持分页设置中子页面路径识别,但不影响编译和调试,是否缺少某些配置(我在官网和GitHub仓库都没找到 Mpx (Official) 相关问题的配置说明),例如:
subPackages: [
{
root: "pages/tabBar1",
pages: ["./navBar"]
},
{
root: "pages/tabBar2",
pages: ["./home"]
},
{
root: "pages/tabBar3",
pages: ["./home"]
}
]

Mpx (Official) 提示:
找不到对应路径文件:'./navBar',请检查文件路径是否正确。
找不到对应路径文件:'./home',请检查文件路径是否正确。
找不到对应路径文件:'./home',请检查文件路径是否正确。

2、是否不支持eslint v10,package.json 中把eslint版本更新为 @eslint/js:"10.0.1" ,"eslint": "10.9.1",之后,VSCode 的 “输出”窗口,“任务”下拉框选中eslint,可以看到eslint的报错信息(VSCode 可能需要关闭后重新打开项目)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue in watch/debug mode using webpack 5.110.3, then compare it with the temporary webpack 5.101.3 override and trace template handling for setup() variables. Verify that loginBg and login.loading render, and treat the Mpx (Official) subPackages path warnings and ESLint 10 report as separate compatibility questions unless the investigation connects them.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.