-
Notifications
You must be signed in to change notification settings - Fork 300
fix: modify the mobile layout and click the example/API. The browser address anchor is not defined, the composition code is hidden, and the home page icon is not found #2806
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
Conversation
…evices and API browser address anchor undefined
WalkthroughThe pull request introduces modifications to three Vue components: Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
WalkthroughThis PR addresses layout and click issues in mobile device examples and resolves an undefined API browser address anchor problem. It includes updates to SVG files for mobile demos and modifies Vue component files to improve functionality and compatibility. Changes
|
@@ -452,7 +452,7 @@ export default defineComponent({ | |||
|
|||
// 兼容ts文档 | |||
if (['interfaces', 'types', 'classes'].includes(state.cmpId)) { | |||
state.activeTab = 'apis' | |||
state.activeTab = 'api' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the tab name matches the expected value in all related components and documentation to avoid inconsistencies.
@@ -604,7 +604,9 @@ export default defineComponent({ | |||
navigator.clipboard.writeText(text) | |||
}, | |||
onTabsClick: (data) => { | |||
router.push(`#${data.name}`) | |||
if (data.name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if data.name
is always defined before using it to prevent potential runtime errors.
@@ -613,7 +615,9 @@ export default defineComponent({ | |||
if (demoId.startsWith('chart') || demoId.startsWith('grid')) { | |||
router.push(demoId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure demoId
is always defined before using it to prevent potential runtime errors.
[e2e-test-warn] The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug". Please make sure you've read our contributing guide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
examples/sites/src/views/components/float-settings.vue (1)
146-153
: Track the temporary mobile mode limitation.The comment indicates that mobile mode temporarily doesn't support composition API. This limitation should be tracked to ensure it's addressed in future updates.
Would you like me to create a GitHub issue to track the implementation of composition API support for mobile mode?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (6)
examples/sites/demos/mobile/overviewimage/container.svg
is excluded by!**/*.svg
examples/sites/demos/mobile/overviewimage/dev.svg
is excluded by!**/*.svg
examples/sites/demos/mobile/overviewimage/dialog-box.svg
is excluded by!**/*.svg
examples/sites/demos/mobile/overviewimage/popover.svg
is excluded by!**/*.svg
examples/sites/demos/mobile/overviewimage/tag.svg
is excluded by!**/*.svg
examples/sites/demos/mobile/overviewimage/user-head.svg
is excluded by!**/*.svg
📒 Files selected for processing (3)
examples/sites/src/views/components/components.vue
(3 hunks)examples/sites/src/views/components/demo.vue
(2 hunks)examples/sites/src/views/components/float-settings.vue
(2 hunks)
🔇 Additional comments (6)
examples/sites/src/views/components/float-settings.vue (1)
121-121
: LGTM!The
isMobile
variable is correctly defined using the environment variable and follows the same pattern as the existingisPlus
variable.examples/sites/src/views/components/components.vue (3)
455-455
: LGTM!The tab activation logic correctly sets the active tab to 'api' for interface, type, and class components, addressing the API browser address anchor undefined issues.
607-609
: LGTM!The condition correctly prevents pushing undefined hash to router when clicking tabs, addressing the undefined anchor issues.
618-620
: LGTM!The condition correctly prevents pushing undefined hash to router when jumping to demos, addressing the undefined anchor issues.
examples/sites/src/views/components/demo.vue (2)
60-61
: Implement the mobile view container content.The mobile view container is empty with only a comment. Please implement the mobile view content or provide more details about the implementation plan.
Would you like me to help implement the mobile view container content?
418-421
: LGTM!The flexbox styles correctly implement the layout structure for the mobile view container.
<component :is="cmp" /> | ||
<div v-else-if="demoConfig.isMobile" class="phone-container-flex"> | ||
<div class="mobile-view-btn"> | ||
<tiny-button>预览</tiny-button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Internationalize the preview button text.
The preview button text "预览" is hardcoded in Chinese. Consider using the i18nByKey
function for internationalization.
Apply this diff to internationalize the text:
- <tiny-button>预览</tiny-button>
+ <tiny-button>{{ i18nByKey('preview') }}</tiny-button>
Committable suggestion skipped: line range outside the PR's diff.
PR信息中带上中文描述 |
Bring a Chinese description in the PR information |
PR
修改移动端布局修改和点击示例/API,浏览器地址锚点未定义undefined,隐藏composition代码展示,首页图标未找到。
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
the issue of modifying the layout and click examples of mobile devices and API browser address anchor undefined
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
Bug Fixes
Refactor