first commit
This commit is contained in:
67
uni_modules/tdesign-uniapp/components/link/README.en-US.md
Normal file
67
uni_modules/tdesign-uniapp/components/link/README.en-US.md
Normal file
@@ -0,0 +1,67 @@
|
||||
:: BASE_DOC ::
|
||||
|
||||
## API
|
||||
|
||||
### Link Props
|
||||
|
||||
name | type | default | description | required
|
||||
-- | -- | -- | -- | --
|
||||
custom-style | Object | - | CSS(Cascading Style Sheets) | N
|
||||
content | String | - | \- | N
|
||||
disabled | Boolean | false | make link to be disabled | N
|
||||
hover | Boolean | - | \- | N
|
||||
navigator-props | Object | {} | \- | N
|
||||
prefix-icon | String / Object | - | \- | N
|
||||
size | String | medium | options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/common/common.ts) | N
|
||||
status | String | normal | `deprecated`。options: normal/active/disabled | N
|
||||
suffix-icon | String / Object | - | \- | N
|
||||
theme | String | default | options: default/primary/danger/warning/success | N
|
||||
underline | Boolean | - | \- | N
|
||||
|
||||
### Link Events
|
||||
|
||||
name | params | description
|
||||
-- | -- | --
|
||||
complete | \- | \-
|
||||
fail | \- | \-
|
||||
success | \- | \-
|
||||
|
||||
### Link Slots
|
||||
|
||||
name | Description
|
||||
-- | --
|
||||
\- | \-
|
||||
content | \-
|
||||
prefix-icon | \-
|
||||
suffix-icon | \-
|
||||
|
||||
### Link External Classes
|
||||
|
||||
className | Description
|
||||
-- | --
|
||||
t-class | class name of root node
|
||||
t-class-content | \-
|
||||
t-class-hover | \-
|
||||
t-class-prefix-icon | \-
|
||||
t-class-suffix-icon | \-
|
||||
|
||||
### CSS Variables
|
||||
|
||||
The component provides the following CSS variables, which can be used to customize styles.
|
||||
Name | Default Value | Description
|
||||
-- | -- | --
|
||||
--td-link-danger-active-color | @error-color-active | -
|
||||
--td-link-danger-color | @error-color | -
|
||||
--td-link-danger-disabled-color | @error-color-disabled | -
|
||||
--td-link-default-active-color | @brand-color-active | -
|
||||
--td-link-default-color | @text-color-primary | -
|
||||
--td-link-default-disabled-color | @text-color-disabled | -
|
||||
--td-link-primary-active-color | @brand-color-active | -
|
||||
--td-link-primary-color | @brand-color | -
|
||||
--td-link-primary-disabled-color | @brand-color-disabled | -
|
||||
--td-link-success-active-color | @success-color-active | -
|
||||
--td-link-success-color | @success-color | -
|
||||
--td-link-success-disabled-color | @success-color-disabled | -
|
||||
--td-link-warning-active-color | @warning-color-active | -
|
||||
--td-link-warning-color | @warning-color | -
|
||||
--td-link-warning-disabled-color | @warning-color-disabled | -
|
||||
115
uni_modules/tdesign-uniapp/components/link/README.md
Normal file
115
uni_modules/tdesign-uniapp/components/link/README.md
Normal file
@@ -0,0 +1,115 @@
|
||||
---
|
||||
title: Link 链接
|
||||
description: 文字超链接用于跳转一个新页面,如当前项目跳转,友情链接等。
|
||||
spline: navigation
|
||||
isComponent: true
|
||||
---
|
||||
|
||||
|
||||
## 引入
|
||||
|
||||
可在 `main.ts` 或在需要使用的页面或组件中引入。
|
||||
|
||||
```js
|
||||
import TLink from '@tdesign/uniapp/link/link.vue';
|
||||
```
|
||||
|
||||
### 组件类型
|
||||
|
||||
基础文字链接
|
||||
|
||||
{{ content }}
|
||||
|
||||
下划线文字链接
|
||||
|
||||
{{ underline }}
|
||||
|
||||
前置图标文字链接
|
||||
|
||||
{{ prefix }}
|
||||
|
||||
后置图标文字链接
|
||||
|
||||
{{ suffix }}
|
||||
|
||||
### 组件状态
|
||||
|
||||
不同主题
|
||||
|
||||
{{ theme }}
|
||||
|
||||
禁用状态
|
||||
|
||||
{{ disabled }}
|
||||
|
||||
### 组件样式
|
||||
|
||||
链接尺寸
|
||||
|
||||
{{ size }}
|
||||
|
||||
## API
|
||||
|
||||
### Link Props
|
||||
|
||||
名称 | 类型 | 默认值 | 描述 | 必传
|
||||
-- | -- | -- | -- | --
|
||||
custom-style | Object | - | 自定义样式 | N
|
||||
content | String | - | 链接内容 | N
|
||||
disabled | Boolean | false | 是否为禁用态 | N
|
||||
hover | Boolean | - | 是否开启点击反馈 | N
|
||||
navigator-props | Object | {} | 与 navigator 原生组件属性保持一致,具体使用参考:[微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html)。使用时请将形如 `open-type` 风格的属性名改为 `openType` 风格 | N
|
||||
prefix-icon | String / Object | - | 前置图标 | N
|
||||
size | String | medium | 尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/common/common.ts) | N
|
||||
status | String | normal | 已废弃。组件状态。可选项:normal/active/disabled | N
|
||||
suffix-icon | String / Object | - | 后置图标 | N
|
||||
theme | String | default | 组件风格,依次为默认色、品牌色、危险色、警告色、成功色。可选项:default/primary/danger/warning/success | N
|
||||
underline | Boolean | - | 是否显示链接下划线 | N
|
||||
|
||||
### Link Events
|
||||
|
||||
名称 | 参数 | 描述
|
||||
-- | -- | --
|
||||
complete | \- | 页面链接执行完成后触发(失败或成功均会触发)
|
||||
fail | \- | 页面链接跳转失败后触发
|
||||
success | \- | 页面链接跳转成功后触发
|
||||
|
||||
### Link Slots
|
||||
|
||||
名称 | 描述
|
||||
-- | --
|
||||
\- | 默认插槽,作用同 `content` 插槽
|
||||
content | 自定义 `content` 显示内容
|
||||
prefix-icon | 自定义 `prefix-icon` 显示内容
|
||||
suffix-icon | 自定义 `suffix-icon` 显示内容
|
||||
|
||||
### Link External Classes
|
||||
|
||||
类名 | 描述
|
||||
-- | --
|
||||
t-class | 根节点样式类
|
||||
t-class-content | 内容样式类
|
||||
t-class-hover | 悬停样式类
|
||||
t-class-prefix-icon | 前置图标样式类
|
||||
t-class-suffix-icon | 后置图标样式类
|
||||
|
||||
### CSS Variables
|
||||
|
||||
组件提供了下列 CSS 变量,可用于自定义样式。
|
||||
名称 | 默认值 | 描述
|
||||
-- | -- | --
|
||||
--td-link-danger-active-color | @error-color-active | -
|
||||
--td-link-danger-color | @error-color | -
|
||||
--td-link-danger-disabled-color | @error-color-disabled | -
|
||||
--td-link-default-active-color | @brand-color-active | -
|
||||
--td-link-default-color | @text-color-primary | -
|
||||
--td-link-default-disabled-color | @text-color-disabled | -
|
||||
--td-link-primary-active-color | @brand-color-active | -
|
||||
--td-link-primary-color | @brand-color | -
|
||||
--td-link-primary-disabled-color | @brand-color-disabled | -
|
||||
--td-link-success-active-color | @success-color-active | -
|
||||
--td-link-success-color | @success-color | -
|
||||
--td-link-success-disabled-color | @success-color-disabled | -
|
||||
--td-link-warning-active-color | @warning-color-active | -
|
||||
--td-link-warning-color | @warning-color | -
|
||||
--td-link-warning-disabled-color | @warning-color-disabled | -
|
||||
118
uni_modules/tdesign-uniapp/components/link/link.css
Normal file
118
uni_modules/tdesign-uniapp/components/link/link.css
Normal file
@@ -0,0 +1,118 @@
|
||||
.t-link--small .t-link__content {
|
||||
font: var(--td-font-body-small, 24rpx / 40rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular));
|
||||
}
|
||||
.t-link--small .t-link__prefix-icon,
|
||||
.t-link--small .t-link__suffix-icon {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.t-link--medium .t-link__content {
|
||||
font: var(--td-font-body-medium, 28rpx / 44rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular));
|
||||
}
|
||||
.t-link--medium .t-link__prefix-icon,
|
||||
.t-link--medium .t-link__suffix-icon {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.t-link--large .t-link__content {
|
||||
font: var(--td-font-body-large, 32rpx / 48rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular));
|
||||
}
|
||||
.t-link--large .t-link__prefix-icon,
|
||||
.t-link--large .t-link__suffix-icon {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.t-link--primary {
|
||||
color: var(--td-link-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
|
||||
}
|
||||
.t-link--primary.t-link--underline::after {
|
||||
border-color: var(--td-link-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
|
||||
}
|
||||
.t-link--primary.t-link--disabled {
|
||||
color: var(--td-link-primary-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
|
||||
}
|
||||
.t-link--primary.t-link--hover {
|
||||
color: var(--td-link-primary-active-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
|
||||
}
|
||||
.t-link--primary.t-link--hover.t-link--underline::after {
|
||||
border-color: var(--td-link-primary-active-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
|
||||
}
|
||||
.t-link--success {
|
||||
color: var(--td-link-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
|
||||
}
|
||||
.t-link--success.t-link--underline::after {
|
||||
border-color: var(--td-link-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
|
||||
}
|
||||
.t-link--success.t-link--disabled {
|
||||
color: var(--td-link-success-disabled-color, var(--td-success-color-disabled, var(--td-success-color-3, #92dab2)));
|
||||
}
|
||||
.t-link--success.t-link--hover {
|
||||
color: var(--td-link-success-active-color, var(--td-success-color-active, var(--td-success-color-6, #008858)));
|
||||
}
|
||||
.t-link--success.t-link--hover.t-link--underline::after {
|
||||
border-color: var(--td-link-success-active-color, var(--td-success-color-active, var(--td-success-color-6, #008858)));
|
||||
}
|
||||
.t-link--warning {
|
||||
color: var(--td-link-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
|
||||
}
|
||||
.t-link--warning.t-link--underline::after {
|
||||
border-color: var(--td-link-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
|
||||
}
|
||||
.t-link--warning.t-link--disabled {
|
||||
color: var(--td-link-warning-disabled-color, var(--td-warning-color-disabled, var(--td-warning-color-3, #ffb98c)));
|
||||
}
|
||||
.t-link--warning.t-link--hover {
|
||||
color: var(--td-link-warning-active-color, var(--td-warning-color-active, var(--td-warning-color-6, #be5a00)));
|
||||
}
|
||||
.t-link--warning.t-link--hover.t-link--underline::after {
|
||||
border-color: var(--td-link-warning-active-color, var(--td-warning-color-active, var(--td-warning-color-6, #be5a00)));
|
||||
}
|
||||
.t-link--default {
|
||||
color: var(--td-link-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
|
||||
}
|
||||
.t-link--default.t-link--underline::after {
|
||||
border-color: var(--td-link-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
|
||||
}
|
||||
.t-link--default.t-link--disabled {
|
||||
color: var(--td-link-default-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
|
||||
}
|
||||
.t-link--default.t-link--hover {
|
||||
color: var(--td-link-default-active-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
|
||||
}
|
||||
.t-link--default.t-link--hover.t-link--underline::after {
|
||||
border-color: var(--td-link-default-active-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
|
||||
}
|
||||
.t-link--danger {
|
||||
color: var(--td-link-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
|
||||
}
|
||||
.t-link--danger.t-link--underline::after {
|
||||
border-color: var(--td-link-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
|
||||
}
|
||||
.t-link--danger.t-link--disabled {
|
||||
color: var(--td-link-danger-disabled-color, var(--td-error-color-disabled, var(--td-error-color-3, #ffb9b0)));
|
||||
}
|
||||
.t-link--danger.t-link--hover {
|
||||
color: var(--td-link-danger-active-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
|
||||
}
|
||||
.t-link--danger.t-link--hover.t-link--underline::after {
|
||||
border-color: var(--td-link-danger-active-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
|
||||
}
|
||||
.t-link {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.t-link--underline::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 0;
|
||||
bottom: 0;
|
||||
opacity: 1;
|
||||
border-bottom: 2rpx solid #cd0be7;
|
||||
}
|
||||
.t-link__prefix-icon:not(:empty) + .t-link__content:not(:empty) {
|
||||
padding-left: 8rpx;
|
||||
}
|
||||
.t-link__content:not(:empty) + .t-link__suffix-icon:not(:empty) {
|
||||
padding-left: 8rpx;
|
||||
}
|
||||
175
uni_modules/tdesign-uniapp/components/link/link.vue
Normal file
175
uni_modules/tdesign-uniapp/components/link/link.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<view>
|
||||
<navigator
|
||||
:class="className + ' ' + tClass"
|
||||
:style="tools._style([customStyle])"
|
||||
:target="navigatorProps.target"
|
||||
:url="!disabled ? (navigatorProps.url || '') : ''"
|
||||
:open-type="navigatorProps.openType || 'navigate'"
|
||||
:delta="navigatorProps.delta"
|
||||
:app-id="navigatorProps.appId"
|
||||
:path="navigatorProps.path"
|
||||
:extra-data="navigatorProps.extraData"
|
||||
:version="navigatorProps.version"
|
||||
:short-link="navigatorProps.shortLink"
|
||||
:hover-class="(hover && !disabled && classPrefix + '--hover') + ' ' + tClassHover + ' ' + navigatorProps.hoverClass"
|
||||
:hover-stop-propagation="!!navigatorProps.hoverStopPropagation"
|
||||
:hover-start-time="navigatorProps.hoverStartTime"
|
||||
:hover-stay-time="navigatorProps.hoverStayTime"
|
||||
:aria-disabled="disabled"
|
||||
@success="onSuccess"
|
||||
@fail="onFail"
|
||||
@complete="onComplete"
|
||||
>
|
||||
<view :class="classPrefix + '__prefix-icon ' + tClassPrefixIcon">
|
||||
<slot name="prefix-icon" />
|
||||
<block
|
||||
v-if="_prefixIcon"
|
||||
name="icon"
|
||||
>
|
||||
<t-icon
|
||||
:custom-style="_prefixIcon.style || ''"
|
||||
:t-class="_prefixIcon.tClass"
|
||||
:prefix="_prefixIcon.prefix"
|
||||
:name="_prefixIcon.name"
|
||||
:size="_prefixIcon.size"
|
||||
:color="_prefixIcon.color"
|
||||
:aria-hidden="true"
|
||||
:aria-label="_prefixIcon.ariaLabel"
|
||||
:aria-role="_prefixIcon.arialRole"
|
||||
@click="_suffixIcon.click || ''"
|
||||
/>
|
||||
</block>
|
||||
</view>
|
||||
<view :class="classPrefix + '__content ' + tClassContent">
|
||||
<block v-if="content">
|
||||
{{ content }}
|
||||
</block>
|
||||
<slot name="content" />
|
||||
<slot />
|
||||
</view>
|
||||
<view :class="classPrefix + '__suffix-icon ' + tClassSuffixIcon">
|
||||
<slot name="suffix-icon" />
|
||||
<block
|
||||
v-if="_suffixIcon"
|
||||
name="icon"
|
||||
>
|
||||
<t-icon
|
||||
:custom-style="_suffixIcon.style || ''"
|
||||
:t-class="_suffixIcon.tClass"
|
||||
:prefix="_suffixIcon.prefix || ''"
|
||||
:name="_suffixIcon.name"
|
||||
:size="_suffixIcon.size"
|
||||
:color="_suffixIcon.color"
|
||||
:aria-hidden="true"
|
||||
:aria-label="_suffixIcon.ariaLabel"
|
||||
:aria-role="_suffixIcon.arialRole"
|
||||
@click="_suffixIcon.click || ''"
|
||||
/>
|
||||
</block>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import TIcon from '../icon/icon';
|
||||
import { uniComponent } from '../common/src/index';
|
||||
import { prefix } from '../common/config';
|
||||
import props from './props';
|
||||
import { calcIcon, coalesce } from '../common/utils';
|
||||
import tools from '../common/utils.wxs';
|
||||
|
||||
|
||||
const name = `${prefix}-link`;
|
||||
|
||||
export default uniComponent({
|
||||
name,
|
||||
externalClasses: [
|
||||
`${prefix}-class`,
|
||||
`${prefix}-class-hover`,
|
||||
`${prefix}-class-prefix-icon`,
|
||||
`${prefix}-class-content`,
|
||||
`${prefix}-class-suffix-icon`,
|
||||
],
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
},
|
||||
components: {
|
||||
TIcon,
|
||||
},
|
||||
props: {
|
||||
...props,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
prefix,
|
||||
classPrefix: name,
|
||||
tools,
|
||||
_prefixIcon: null,
|
||||
_suffixIcon: null,
|
||||
className: '',
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
prefixIcon: {
|
||||
handler(value) {
|
||||
this._prefixIcon = calcIcon(value);
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
suffixIcon: {
|
||||
handler(value) {
|
||||
this._suffixIcon = calcIcon(value);
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
theme: 'setClass',
|
||||
disabled: 'setClass',
|
||||
size: 'setClass',
|
||||
underline: 'setClass',
|
||||
navigatorProps: 'setClass',
|
||||
},
|
||||
mounted() {
|
||||
this.setClass();
|
||||
},
|
||||
methods: {
|
||||
setClass() {
|
||||
const { theme, size, underline, navigatorProps, disabled } = this;
|
||||
const classList = [name, `${name}--${theme}`, `${name}--${size}`];
|
||||
const { url, appId, shortLink, target, openType } = coalesce(navigatorProps, {});
|
||||
const condition = !(url || (target === 'miniProgram' && (appId || shortLink)));
|
||||
|
||||
if (underline) {
|
||||
classList.push(`${name}--underline`);
|
||||
}
|
||||
if (
|
||||
(Object.keys(navigatorProps).length && condition && !['navigateBack', 'exit'].includes(openType))
|
||||
|| disabled
|
||||
) {
|
||||
classList.push(`${name}--disabled`);
|
||||
}
|
||||
|
||||
this.className = classList.join(' ');
|
||||
},
|
||||
onSuccess(e) {
|
||||
this.$emit('success', e);
|
||||
},
|
||||
onFail(e) {
|
||||
this.$emit('fail', e);
|
||||
},
|
||||
onComplete(e) {
|
||||
this.$emit('complete', e);
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './link.css';
|
||||
|
||||
/* #ifdef H5 */
|
||||
:deep(.navigator-wrap) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
/* #endif */
|
||||
</style>
|
||||
65
uni_modules/tdesign-uniapp/components/link/props.ts
Normal file
65
uni_modules/tdesign-uniapp/components/link/props.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
|
||||
* */
|
||||
|
||||
import type { TdLinkProps } from './type';
|
||||
export default {
|
||||
/** 链接内容 */
|
||||
content: {
|
||||
type: String,
|
||||
},
|
||||
/** 是否为禁用态 */
|
||||
disabled: Boolean,
|
||||
/** 是否开启点击反馈 */
|
||||
hover: Boolean,
|
||||
/** 与 navigator 原生组件属性保持一致,具体使用参考:[微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html)。使用时请将形如 `open-type` 风格的属性名改为 `openType` 风格 */
|
||||
navigatorProps: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
/** 前置图标 */
|
||||
prefixIcon: {
|
||||
type: [String, Object],
|
||||
},
|
||||
/** 尺寸 */
|
||||
size: {
|
||||
type: String,
|
||||
default: 'medium' as TdLinkProps['size'],
|
||||
validator(val: TdLinkProps['size']): boolean {
|
||||
if (!val) return true;
|
||||
return ['small', 'medium', 'large'].includes(val);
|
||||
},
|
||||
},
|
||||
/** 后置图标 */
|
||||
suffixIcon: {
|
||||
type: [String, Object],
|
||||
},
|
||||
/** 组件风格,依次为默认色、品牌色、危险色、警告色、成功色 */
|
||||
theme: {
|
||||
type: String,
|
||||
default: 'default' as TdLinkProps['theme'],
|
||||
validator(val: TdLinkProps['theme']): boolean {
|
||||
if (!val) return true;
|
||||
return ['default', 'primary', 'danger', 'warning', 'success'].includes(val);
|
||||
},
|
||||
},
|
||||
/** 是否显示链接下划线 */
|
||||
underline: Boolean,
|
||||
/** 页面链接执行完成后触发(失败或成功均会触发) */
|
||||
onComplete: {
|
||||
type: Function,
|
||||
default: () => ({}),
|
||||
},
|
||||
/** 页面链接跳转失败后触发 */
|
||||
onFail: {
|
||||
type: Function,
|
||||
default: () => ({}),
|
||||
},
|
||||
/** 页面链接跳转成功后触发 */
|
||||
onSuccess: {
|
||||
type: Function,
|
||||
default: () => ({}),
|
||||
},
|
||||
};
|
||||
62
uni_modules/tdesign-uniapp/components/link/type.ts
Normal file
62
uni_modules/tdesign-uniapp/components/link/type.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
|
||||
* */
|
||||
|
||||
import type { SizeEnum } from '../common/common';
|
||||
|
||||
export interface TdLinkProps {
|
||||
/**
|
||||
* 链接内容
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* 是否为禁用态
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean;
|
||||
/**
|
||||
* 是否开启点击反馈
|
||||
*/
|
||||
hover?: boolean;
|
||||
/**
|
||||
* 与 navigator 原生组件属性保持一致,具体使用参考:[微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html)。使用时请将形如 `open-type` 风格的属性名改为 `openType` 风格
|
||||
* @default {}
|
||||
*/
|
||||
navigatorProps?: object;
|
||||
/**
|
||||
* 前置图标
|
||||
*/
|
||||
prefixIcon?: string | object;
|
||||
/**
|
||||
* 尺寸
|
||||
* @default medium
|
||||
*/
|
||||
size?: SizeEnum;
|
||||
/**
|
||||
* 后置图标
|
||||
*/
|
||||
suffixIcon?: string | object;
|
||||
/**
|
||||
* 组件风格,依次为默认色、品牌色、危险色、警告色、成功色
|
||||
* @default default
|
||||
*/
|
||||
theme?: 'default' | 'primary' | 'danger' | 'warning' | 'success';
|
||||
/**
|
||||
* 是否显示链接下划线
|
||||
*/
|
||||
underline?: boolean;
|
||||
/**
|
||||
* 页面链接执行完成后触发(失败或成功均会触发)
|
||||
*/
|
||||
onComplete?: () => void;
|
||||
/**
|
||||
* 页面链接跳转失败后触发
|
||||
*/
|
||||
onFail?: () => void;
|
||||
/**
|
||||
* 页面链接跳转成功后触发
|
||||
*/
|
||||
onSuccess?: () => void;
|
||||
}
|
||||
Reference in New Issue
Block a user