# PmNavigation
# 基本用法
<template>
<div>
<el-button @click="gotoDesign" type="primary">上传</el-button>
<pm-navigation ref="nav" :routes="routes" :allow-click="true" />
</div>
</template>
<script>
export default {
data() {
return {
routes: [
{
title: '复制',
name: 'copy',
props: { data: '复制' },
component: 'pm-clip-button',
children: [
{
title: '绑定',
name: 'bind',
component: 'pm-bind',
props: {
bindDefaultValue: '绑定',
},
children: [
{
title: '上传',
name: 'upload',
props: {
uploadUrl: "https://jsonplaceholder.typicode.com/posts/",
removeAction: () => {},
autoUpload: false
},
component: 'pm-upload',
},
],
},
]
}
]
}
},
mounted() {
this.init()
},
methods: {
init() {
if (!this.$refs['nav']) {
return false
}
this.$refs['nav'].goto({
name: 'bind',
props: this.$props,
title: `绑定`
})
},
gotoDesign() {
this.$refs['nav'].goto({
name: 'upload',
props: this.$props,
title: `上传`
})
}
}
}
</script>
# Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
routes | 路由数组 | array | - | [] |
bodyStyle | 内容区域容易样式 | string | - | - |
autoInit | 自动跳转第一个 | boolean | - | true |
cacheInclude | keep-alive缓存列表 | object | - | - |
allowClick | 面包屑允许点击 | boolean | - | true |