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

[wip] refactor: refactor mobile site #2808

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 0 additions & 106 deletions examples/sites/demos/apis/actionsheet.js

This file was deleted.

47 changes: 13 additions & 34 deletions examples/sites/demos/apis/alert.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
mode: ['pc', 'mobile', 'mobile-first'],
mode: ['pc', 'mobile-first'],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Migration to 'mobile-first' needs attention in sticky.js

The removal of 'mobile' mode is generally well-supported as most files already include both 'mobile' and 'mobile-first' modes. However, sticky.js only supports 'pc' and 'mobile' modes without 'mobile-first', which needs to be addressed as part of the mobile site refactoring.

  • examples/sites/demos/apis/sticky.js: Add 'mobile-first' mode support
🔗 Analysis chain

Verify the impact of removing 'mobile' mode.

The removal of 'mobile' mode from the supported modes array aligns with the PR's mobile site refactoring objective. However, we should verify that all mobile-specific functionality has been properly migrated to 'mobile-first'.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining 'mobile' mode references
rg -l "'mobile'" examples/sites/demos/apis/

Length of output: 1306


Script:

#!/bin/bash
# Search for mode declarations containing 'mobile'
rg -A 2 -B 2 "mode:.*'mobile'.*" examples/sites/demos/apis/

Length of output: 26286

apis: [
{
name: 'alert',
Expand All @@ -13,9 +13,8 @@ export default {
'zh-CN': '文字是否居中',
'en-US': 'Whether the text is centered'
},
mode: ['pc', 'mobile', 'mobile-first'],
mode: ['pc', 'mobile-first'],
pcDemo: 'center',
mobileDemo: 'center',
mfDemo: ''
},
{
Expand All @@ -26,9 +25,8 @@ export default {
'zh-CN': '警告是否可以关闭',
'en-US': 'Set whether alarms can be disabled.'
},
mode: ['pc', 'mobile', 'mobile-first'],
mode: ['pc', 'mobile-first'],
pcDemo: 'custom-close',
mobileDemo: 'custom-close',
mfDemo: ''
},
{
Expand All @@ -39,9 +37,8 @@ export default {
'zh-CN': '关闭按钮自定义文本',
'en-US': 'Customized text of the close button'
},
mode: ['pc', 'mobile', 'mobile-first'],
mode: ['pc', 'mobile-first'],
pcDemo: 'custom-close',
mobileDemo: 'custom-close',
mfDemo: ''
},
{
Expand All @@ -64,9 +61,8 @@ export default {
'zh-CN': '警告的提示内容',
'en-US': 'Set the warning prompt content'
},
mode: ['pc', 'mobile', 'mobile-first'],
mode: ['pc', 'mobile-first'],
pcDemo: 'basic-usage',
mobileDemo: 'custom-close',
mfDemo: ''
},
{
Expand All @@ -78,14 +74,13 @@ export default {
'en-US':
'The icon for the custom warning of the incoming icon component will be automatically used based on the type value by default'
},
mode: ['pc', 'mobile', 'mobile-first'],
mode: ['pc', 'mobile-first'],
pcDemo: 'icon',
mobileDemo: 'icon',
mfDemo: ''
},
{
name: 'scrolling',
type: 'String',
type: 'string',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix inconsistent type definitions.

The following properties are defined with string type but their descriptions suggest they should be boolean:

  • scrolling: Controls animation behavior
  • show-foldable: Controls collapsible style
  • single-line: Controls text overflow behavior

Consider updating their types to boolean for consistency.

Also applies to: 95-95, 132-132

defaultValue: '',
desc: {
'zh-CN': '是否开启描述文字在鼠标 hover 时滚动显示的动画。',
Expand All @@ -97,7 +92,7 @@ export default {
},
{
name: 'show-foldable',
type: 'String',
type: 'string',
defaultValue: '',
desc: {
'zh-CN': '展示带标题可折叠样式。',
Expand Down Expand Up @@ -134,7 +129,7 @@ export default {
},
{
name: 'single-line',
type: 'String',
type: 'string',
defaultValue: '',
desc: {
'zh-CN': '描述内容是否一行显示,超出显示...,默认值为 false。',
Expand All @@ -151,23 +146,10 @@ export default {
'zh-CN': '警告的尺寸大小',
'en-US': 'Set the size of the warning'
},
mode: ['pc', 'mobile', 'mobile-first'],
mode: ['pc', 'mobile-first'],
pcDemo: 'size',
mobileDemo: 'size',
mfDemo: ''
},
{
name: 'target',
type: 'String',
defaultValue: '',
desc: {
'zh-CN': '挂载容器的ref值,通过该属性可以让组件展示在对应容器的顶部',
'en-US':
'Mounted container reference, this property allows the component to be displayed at the top of the corresponding container.'
},
mode: ['mobile'],
mobileDemo: 'target'
},
{
name: 'title',
type: 'string',
Expand All @@ -190,9 +172,8 @@ export default {
'zh-CN': '警告的类型',
'en-US': 'Set the alarm type'
},
mode: ['pc', 'mobile', 'mobile-first'],
mode: ['pc', 'mobile-first'],
pcDemo: 'basic-usage',
mobileDemo: 'size',
mfDemo: ''
}
],
Expand All @@ -205,9 +186,8 @@ export default {
'zh-CN': '关闭 alert 时触发的事件',
'en-US': 'Event triggered when the alert function is disabled'
},
mode: ['pc', 'mobile', 'mobile-first'],
mode: ['pc', 'mobile-first'],
pcDemo: 'custom-close',
mobileDemo: 'custom-close',
mfDemo: ''
},
{
Expand Down Expand Up @@ -265,9 +245,8 @@ export default {
'zh-CN': '组件默认插槽,当 size 设置为 large 时有效,显示在 <code>description</code>下方 ',
'en-US': 'The default slot for the component is valid when size is set to large'
},
mode: ['pc', 'mobile', 'mobile-first'],
mode: ['pc', 'mobile-first'],
pcDemo: 'slot-default',
mobileDemo: 'slot-default',
mfDemo: ''
},
{
Expand Down
113 changes: 0 additions & 113 deletions examples/sites/demos/apis/avatar.js

This file was deleted.

Loading