cnpm install buefy
// 在 main.js 中添加:
import Buefy from 'buefy'
import 'buefy/dist/buefy.css'
Vue.use(Buefy)
<template>
<b-navbar>
<template slot="brand">
<b-navbar-item tag="router-link" :to="{ path: '/' }">
<img src="../assets/images/belstar-logo.png">
</b-navbar-item>
</template>
<template slot="start">
<b-navbar-item href="/">
Home
</b-navbar-item>
<b-navbar-item href="https://gridsome.org/">
Documentation
</b-navbar-item>
<b-navbar-dropdown label="Blog">
<b-navbar-item :href="edge.node.path" v-for="edge in $page.posts.edges" :key="edge.node.id">
{{edge.node.title}}
</b-navbar-item>
</b-navbar-dropdown>
</template>
</b-navbar>
</template>
<page-query>
query {
posts: allPost(filter: { published: { eq: true }}) {
edges {
node {
id
title
description
cover_image (width: 770, height: 380, blur: 10)
path
tags {
id
title
path
}
}
}
}
}
</page-query>
优势
: