-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add app visible handler && Weibo login
- Loading branch information
Showing
13 changed files
with
271 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<template > | ||
<ul class="cpt-links-panel"> | ||
<li class="link-item" v-for="link in links" :key="link.name"> | ||
<div class="link-name">{{ link.name }}</div> | ||
<div class="link-content"> | ||
<input class="copy-input" type="text" :value="link.value"> | ||
<span class="copy-button" @click="copyLink(link.value)">复制</span> | ||
</div> | ||
</li> | ||
</ul> | ||
</template> | ||
|
||
<script> | ||
import copy from '../util/copy' | ||
export default { | ||
props: { | ||
url: String | ||
}, | ||
computed: { | ||
links () { | ||
const { url } = this | ||
return [ | ||
{ | ||
name: 'Markdown', | ||
value: `![](${url})` | ||
}, | ||
{ | ||
name: '图片链接', | ||
value: url | ||
}, | ||
{ | ||
name: 'UBB', | ||
value: `[IMG]${url}[/IMG]` | ||
}, | ||
{ | ||
name: 'HTML', | ||
value: `<img src="${url}"/>` | ||
} | ||
] | ||
} | ||
}, | ||
methods: { | ||
copyLink (v) { | ||
copy(v, ok => { | ||
if (ok) { | ||
this.$swal({ | ||
text: '复制成功', | ||
icon: 'success', | ||
buttons: false, | ||
timer: 1000 | ||
}) | ||
} else { | ||
this.$swal({ | ||
text: '复制失败,请手动复制练级地址', | ||
icon: 'warning', | ||
buttons: false, | ||
timer: 1000 | ||
}) | ||
} | ||
}) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.cpt-links-panel { | ||
list-style: none; | ||
font-size: 12px; | ||
text-align: left; | ||
.link-item { | ||
margin: 10px 0; | ||
} | ||
.link-name { | ||
color: #929aa3; | ||
padding: 4px 0; | ||
} | ||
.link-content { | ||
display: flex; | ||
align-items: center; | ||
.copy-input, | ||
.copy-button { | ||
padding: 4px 10px; | ||
border: 1px solid #eee; | ||
border-radius: 4px; | ||
} | ||
.copy-input { | ||
flex: 1; | ||
margin-right: 10px; | ||
color: #222; | ||
outline: none; | ||
} | ||
.copy-button { | ||
cursor: pointer; | ||
} | ||
} | ||
} | ||
</style> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Vue from 'vue' | ||
import main from './links-panel' | ||
|
||
const Ctor = Vue.extend(main) | ||
|
||
let ins = null | ||
|
||
export default function showLinks (url) { | ||
if (!ins) { | ||
ins = new Ctor({ propsData: { url } }).$mount() | ||
} else { | ||
ins.url = url | ||
} | ||
return ins.$el | ||
} | ||
|
Oops, something went wrong.