123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <template>
- <text class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}" :style="{color,fontSize:fontSize+'px'}" @click="openURL">{{text}}</text>
- </template>
- <script>
-
- export default {
- name: 'uniLink',
- props: {
- href: {
- type: String,
- default: ''
- },
- text: {
- type: String,
- default: ''
- },
- showUnderLine: {
- type: [Boolean, String],
- default: true
- },
- copyTips: {
- type: String,
- default: '已自动复制网址,请在手机浏览器里粘贴该网址'
- },
- color: {
- type: String,
- default: '#999999'
- },
- fontSize: {
- type: [Number, String],
- default: 14
- }
- },
- methods: {
- openURL() {
-
- plus.runtime.openURL(this.href)
-
-
- window.open(this.href)
-
-
- uni.setClipboardData({
- data: this.href
- });
- uni.showModal({
- content: this.copyTips,
- showCancel: false
- });
-
- }
- }
- }
- </script>
- <style scoped>
- .uni-link--withline {
- text-decoration: underline;
- }
- </style>
|