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

@ -15,26 +15,12 @@
<script>
import mixinsLink from '../../mixins/link';
const prefixCls = 'ivu-breadcrumb-item';
import { oneOf } from '../../utils/assist';
export default {
name: 'BreadcrumbItem',
mixins: [ mixinsLink ],
props: {
to: {
type: [Object, String]
},
replace: {
type: Boolean,
default: false
},
target: {
type: String,
validator (value) {
return oneOf(value, ['_blank', '_self', '_parent', '_top']);
},
default: '_self'
}
},
data () {
return {

View file

@ -68,20 +68,6 @@
type: Boolean,
default: false
},
to: {
type: [Object, String]
},
replace: {
type: Boolean,
default: false
},
target: {
type: String,
validator (value) {
return oneOf(value, ['_blank', '_self', '_parent', '_top']);
},
default: '_self'
}
},
data () {
return {

View file

@ -4,7 +4,7 @@
</template>
<script>
import Emitter from '../../mixins/emitter';
import { findComponentUpward, oneOf } from '../../utils/assist';
import { findComponentUpward } from '../../utils/assist';
const prefixCls = 'ivu-menu';
import mixin from './mixin';
import mixinsLink from '../../mixins/link';
@ -21,20 +21,6 @@
type: Boolean,
default: false
},
to: {
type: [Object, String]
},
replace: {
type: Boolean,
default: false
},
target: {
type: String,
validator (value) {
return oneOf(value, ['_blank', '_self', '_parent', '_top']);
},
default: '_self'
}
},
data () {
return {

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;