mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 01:54:48 +00:00
chore: merge vant-doc to vant-cli
This commit is contained in:
23
packages/vant-cli/site/desktop/components/NavLink.vue
Normal file
23
packages/vant-cli/site/desktop/components/NavLink.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<router-link v-if="item.path" active-class="active" :to="base + item.path" v-html="itemName" />
|
||||
<a v-else-if="item.link" :href="item.link" v-html="itemName" />
|
||||
<a v-else v-html="itemName " />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'van-doc-nav-link',
|
||||
|
||||
props: {
|
||||
base: String,
|
||||
item: Object
|
||||
},
|
||||
|
||||
computed: {
|
||||
itemName() {
|
||||
const name = (this.item.title || this.item.name).split(' ');
|
||||
return `${name[0]} <span>${name.slice(1).join(' ')}</span>`;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Reference in New Issue
Block a user