🌌 EMQ Community Websites Header.
yarn add @emqx/community-websites-header
EMQHeader.ts
import Vue from 'vue'
import EMQHeader from '@emqx/community-websites-header'
Vue.use(EMQHeader)
nuxt.config.ts
{
plugins: [{ src: '~/plugins/EMQHeader', ssr: false },],
}
default.vue
<client-only>
<EMQHeader :lang="$i18n.locale" product="emqx" />
</client-only>
enhanceApp.js
export default ({
Vue, // the version of Vue being used in the VuePress app
options, // the options for the root Vue instance
router, // the router instance for the app
siteData, // site metadata
}) => {
...
Vue.mixin({
mounted() {
const EMQHeader = require('@emqx/community-websites-header')
Vue.use(EMQHeader)
},
})
}
Layout.vue
<EMQHeader :lang="$lang === 'en' ? 'en' : 'zh'" product="emqx" />
Attributes | Description | Type | Accepted Values | Default |
---|---|---|---|---|
lang | Page Language | string | en / zh | en |
product | Show Github Stars | string | emqx / neuron / nanomq / mqttx | — |
npm login
yarn lib
npm publish