Files
aurora-admin/site/sources/breadcrumb/vue2.txt
T

20 lines
690 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="kole-breadcrumb">
<!-- Vue 2 不允许在 <template v-for> 上写 :key,key 必须落在真实元素上 -->
<template v-for="(it, i) in items">
<span :key="'item-' + i" class="kole-breadcrumb-item" :class="{ 'is-current': i === items.length - 1 }"
@click="i !== items.length - 1 && $emit('select', it)">{{ it.label }}</span>
<span v-if="i !== items.length - 1" :key="'sep-' + i" class="kole-breadcrumb-sep">/</span>
</template>
</div>
</template>
<script>
export default {
name: 'KoleBreadcrumb',
props: { items: { type: Array, default: function () { return []; } } }
};
</script>
<style src="./Breadcrumb.css"></style>