uView Link 超链接

该组件为超链接组件,在不同平台有不同表现形式:

  • 在APP平台会通过plus环境打开内置浏览器
  • 在小程序中把链接复制到粘贴板,同时提示信息
  • 在H5中通过window.open打开链接

#平台差异说明

App(vue) App(nvue) H5 小程序

#基本使用

  • 通过href设置打开的链接,text设置显示的内容
<template>
	<u-link href="https://uviewui.com/" text="打开uView UI文档" @click="click"></u-link>
</template>

<script>
	export default {
		methods: {
			click() {
				console.log('click');
			}
		}
	}
</script>

copy

#下划线

通过under-line设置是否显示链接的下划线

<template>
	<u-link href="https://uviewui.com/" text="打开uView UI文档" :under-line="true"></u-link>
</template>

copy

#自定义颜色

  • 通过color设置文字颜色
  • 通过line-color设置下划线颜色
<template>
	<u-link href="https://uviewui.com/" text="打开uView UI文档" color="#19be6b" line-color="#19be6b"></u-link>
</template>

猜你喜欢

转载自blog.csdn.net/m0_72196169/article/details/135464317