mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
55 lines
857 B
Vue
55 lines
857 B
Vue
<template>
|
|
<n-button
|
|
class="edit-button"
|
|
ghost
|
|
round
|
|
:size="size"
|
|
:text="text"
|
|
@click="handleEditOnGithubClick"
|
|
>
|
|
<template v-slot:icon>
|
|
<edit-icon />
|
|
</template>
|
|
</n-button>
|
|
</template>
|
|
|
|
<script>
|
|
import editIcon from '../../src/_icons/create-outline'
|
|
|
|
export default {
|
|
name: 'EditOnGithubButton',
|
|
components: {
|
|
editIcon
|
|
},
|
|
props: {
|
|
url: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
text: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
size: {
|
|
type: String,
|
|
default: undefined
|
|
}
|
|
},
|
|
data () {
|
|
return {
|
|
gheUrl: 'https://***REMOVED***/tree/develop/'
|
|
}
|
|
},
|
|
computed: {
|
|
gheDocUrl () {
|
|
return this.gheUrl + this.url
|
|
}
|
|
},
|
|
methods: {
|
|
handleEditOnGithubClick () {
|
|
window.open(this.gheDocUrl, '_blank')
|
|
}
|
|
}
|
|
}
|
|
</script>
|