mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
Merge pull request #301 from albertms10/link-href
feat(link): add href prop
This commit is contained in:
commit
0b9688dc2b
3 changed files with 13 additions and 0 deletions
|
@ -2179,6 +2179,7 @@ import { Link } from "carbon-components-svelte";
|
|||
|
||||
| Prop name | Type | Default value |
|
||||
| :-------- | :--------------------------------------------------------------------- | :------------ |
|
||||
| href | <code>string</code> | -- |
|
||||
| inline | <code>boolean</code> | false |
|
||||
| disabled | <code>boolean</code> | false |
|
||||
| visited | <code>boolean</code> | false |
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the href value
|
||||
* @type {string} [href]
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Set to `true` to use the inline variant
|
||||
* @type {boolean} [inline=false]
|
||||
|
@ -48,6 +54,7 @@
|
|||
class:bx--link--inline="{inline}"
|
||||
class:bx--link--visited="{visited}"
|
||||
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
|
||||
{href}
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
|
|
5
types/index.d.ts
vendored
5
types/index.d.ts
vendored
|
@ -1884,6 +1884,11 @@ export class InlineNotification extends CarbonSvelteComponent {
|
|||
|
||||
export class Link extends CarbonSvelteComponent {
|
||||
$$prop_def: {
|
||||
/**
|
||||
* Specify the href value
|
||||
*/
|
||||
href?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to use the inline variant
|
||||
* @default false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue