This commit is contained in:
梁灏 2018-06-21 10:36:53 +08:00
parent 3cf11946f2
commit 9932b935fe
4 changed files with 20 additions and 44 deletions

View file

@ -1,4 +1,22 @@
import { oneOf } from '../utils/assist';
export default {
props: {
to: {
type: [Object, String]
},
replace: {
type: Boolean,
default: false
},
target: {
type: String,
validator (value) {
return oneOf(value, ['_blank', '_self', '_parent', '_top']);
},
default: '_self'
}
},
computed: {
linkUrl () {
const type = typeof this.to;