# Link link
- Open the link in H5 through
window.open
- In the APP platform, the built-in browser will be opened through the
plus
environment - Copy the link to the clipboard in the applet, and prompt the information at the same time
# Import
import PressLink from 'press-ui/press-link/press-link';
export default {
components: {
PressLink,
}
}
# Code demonstration
# Basic usage
Use href
to set the link to be opened, and text
to set the displayed content.
<PressLink
:text="t('openDocs')"
href="https://novlan1.github.io/press-ui/"
@click="click"
/>
export default {
methods: {
click() {}
}
}
# Underline
Use underline
to set whether to display the underline of the link.
<PressLink
underline
:text="t('openDocs')"
href="https://novlan1.github.io/press-ui/"
@click="click"
/>
# Custom color
Use color
to set the text color.
<PressLink
:text="t('openDocs')"
color="#19be6b"
href="https://novlan1.github.io/press-ui/"
@click="click"
/>
# API
# Props
Parameter | Description | Type | Default value |
---|---|---|---|
text | text | string | - |
color | text color | string | #2979ff |
font-size | font size, unit px | string | number | 15 |
underline | whether to display underline | boolean | false |
href | link to jump to | string | - |
mp-tips | prompts copied to the clipboard in the mini program | string | Link copied, please open in browser |
# Events
Event name | Description | Parameters |
---|---|---|
click | Click | - |
# Online debugging
← ImagePreview List →