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

feat: 移动端高清方案支持配置 #335

Closed
KMBaby-zyl opened this issue Sep 24, 2020 · 13 comments
Closed

feat: 移动端高清方案支持配置 #335

KMBaby-zyl opened this issue Sep 24, 2020 · 13 comments
Labels
enhancement New feature or request

Comments

@KMBaby-zyl
Copy link

KMBaby-zyl commented Sep 24, 2020

版本

"dumi-theme-mobile": "^1.0.0-beta.2",
"dumi": "^1.1.0-beta.23",

效果

查看手机框内的iframe中的demo页面 http://localhost:8000/mtd/react-mobile~demos/Dialog-4 没有正常渲染

image

貌似umi的router没有进入demos

@KMBaby-zyl KMBaby-zyl added the bug Something isn't working label Sep 24, 2020
@KMBaby-zyl
Copy link
Author

@xiaohuoni

@KMBaby-zyl
Copy link
Author

测试发现 .umirc中有 base的时候手机端路由错误,组件出不来

@xiaohuoni
Copy link
Member

收到,我晚点修下。这个上次有提到可能会有错。忘记覆盖场景了。

@PeachScript
Copy link
Member

@KMBaby-zyl 确保 config 中的 base 以 / 结尾
@xiaohuoni base 的支持加上了的,可以给 base 加个校验或者和 umi 一样自动追加 /,不止一位用户配错了

@PeachScript PeachScript added enhancement New feature or request and removed bug Something isn't working labels Sep 25, 2020
@xiaohuoni
Copy link
Member

xiaohuoni commented Sep 25, 2020

@PeachScript 用的不是 umi 的 base 嘛?

@KMBaby-zyl
Copy link
Author

KMBaby-zyl commented Sep 25, 2020

umi-hd 可以选择不使用吗? 我们业务都没有用meta做hd。 umi-hd会导致px的组件展示有问题
@PeachScript

@PeachScript
Copy link
Member

@PeachScript 用的不是 umi 的 base 嘛?

读的 window.routerBase 拼接的,有更好的方式吗

@xiaohuoni
Copy link
Member

如果只是结尾 / 的问题,代码判断一下补上问题不大。

@xiaohuoni
Copy link
Member

umi-hd 可以选择不使用吗? 我们业务都没有用meta做hd。 umi-hd会导致px的组件展示有问题
@PeachScript

@PeachScript 这个问题,也有其他同学说了,要想个方式,传配置到主题。

@PeachScript
Copy link
Member

@xiaohuoni 有想到比较好的方式吗?感觉只能加个 themeConfig 配置项,但是和 theme 配置项语义上会混淆

@KMBaby-zyl
Copy link
Author

@xiaohuoni 有想到比较好的方式吗?感觉只能加个 themeConfig 配置项,但是和 theme 配置项语义上会混淆

这个配置项有进展吗

@FrontEndZhang
Copy link

这个bug修复了吗?部署就遇到这个问题了
history为hash,移动端的iframe地址为: http://localhost:8000/~demos/docs-test,导致显示不了
如果改成 http://localhost:8000#/~demos/docs-test,就可以显示

@PeachScript PeachScript changed the title bug: 移动端组件展示问题 feat: 移动端高清方案支持配置 Nov 30, 2020
@PeachScript
Copy link
Member

v1.1.0-rc.5 开始,移动端主题支持配置高清方案了:

// .umirc.ts
export default {
  // ...
  themeConfig: {
    hd: {
      rules: [] // 禁用高清方案
      // 更多 rule 配置访问 https://github.com/umijs/dumi/blob/master/packages/theme-mobile/src/typings/config.d.ts#L7
    }
  }
}

issue 关闭

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

No branches or pull requests

4 participants