<template>
	<el-breadcrumb class="edit-path" separator-class="el-icon-arrow-right">
		<el-breadcrumb-item v-for="(process, index) in processStack" :key="index">
			<span v-if="index === processStack.length - 1">{{parseName(process)}}</span>
			<el-link v-else @click="onClickItem(process, index)">{{parseName(process)}}</el-link>
		</el-breadcrumb-item>
	</el-breadcrumb>
</template>

<script>
	export default {
		name: "EditPath",
		props: ['processStack'],
		watch: {
			processStack(v){
				//console.log(v);
			}
		},
		methods: {
			parseName(process){
				return process.meta.name;
			},
			onClickItem(process, index){
				this.$emit('pop', index);
			},
		}
	}
</script>

<style scoped>

</style>