Skip to content

Comments

docs(link): add link component target api docs#4082

Open
IKEYCY wants to merge 2 commits intoopentiny:devfrom
IKEYCY:IKEYCY/Add-link-component-target
Open

docs(link): add link component target api docs#4082
IKEYCY wants to merge 2 commits intoopentiny:devfrom
IKEYCY:IKEYCY/Add-link-component-target

Conversation

@IKEYCY
Copy link
Contributor

@IKEYCY IKEYCY commented Feb 10, 2026

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features
    • Added a new public target prop to the Link component to control where links open (_blank, _self, _parent, _top), defaulting to _self.
    • Added interactive demos showing each target behavior.
    • Added automated tests validating link target attributes and href values to ensure correct runtime behavior.

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

Walkthrough

Adds a new target public prop to the Link component and supplies demos, a composition-api demo, Playwright tests, and a documentation demo entry demonstrating and verifying the four target modes (_blank, _self, _parent, top).

Changes

Cohort / File(s) Summary
API Definition
examples/sites/demos/apis/link.js
Appended a new public prop target with type `'_self'
Demo Components
examples/sites/demos/pc/app/link/target.vue, examples/sites/demos/pc/app/link/target-composition-api.vue
Added two Vue demo components rendering four TinyLink instances with targets _blank, _self, _parent, _top (underline disabled), plus scoped layout styles.
Test Coverage
examples/sites/demos/pc/app/link/target.spec.ts
Added Playwright tests asserting there are 4 demo links, each has the expected target attribute and link text, and all links share the expected href; includes pageerror handler.
Documentation
examples/sites/demos/pc/app/link/webdoc/link.js
Inserted a new demo entry (demoId: 'target') with localized name and description referencing target.vue in the demos array.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A little prop named target springs,
Four doors to open, fluttering wings,
Demos lined up, tests hop through,
Docs show the paths, both old and new,
I nibble code crumbs — delight in small things.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(link): add link component target api docs' accurately describes the main change: adding documentation and demo files for the link component's target API property.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

🤖 Fix all issues with AI agents
In `@examples/sites/demos/apis/link.js`:
- Around line 74-84: The pcDemo value is incorrect: update the property pcDemo
on the prop object for name 'target' from 'open-mode' to 'target' so it matches
the demo entry demoId 'target' (which references codeFiles ['target.vue']);
ensure the object containing name: 'target' has pcDemo: 'target' to restore
correct linking between the prop and the demo.

'en-US': 'Link open mode'
},
mode: ['pc'],
pcDemo: 'open-mode'
Copy link
Member

Choose a reason for hiding this comment

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

这里是不是要改成:‘target’

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 this pull request may close these issues.

2 participants