Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Commit

Permalink
⚡ improvement: plugin version in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Jan 20, 2019
1 parent 6c02a68 commit f36e526
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions generator/templates/docs/docs/_vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
plugins: [
require('./plugin.js')
],
locales: {
'/': {
lang: 'en-US',
Expand Down
19 changes: 19 additions & 0 deletions generator/templates/docs/docs/_vuepress/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { version } = require('../../package.json')

module.exports = (/*options, ctx*/) => ({
async enhanceAppFiles () {
const code = `export default ({ Vue }) => {
Vue.mixin({
computed: {
$version () {
return '${version}'
}
}
})
}`
return [{
name: 'vuepress-plugin-vue-cli-plugin-p11n',
content: code
}]
}
})
2 changes: 1 addition & 1 deletion generator/templates/docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

https://unpkg.com/<%= repoName %>/dist/<%= distName %>

[unpkg.com](https://unpkg.com) provides NPM-based CDN links. The above link will always point to the latest release on NPM. You can also use a specific version/tag via URLs like https://unpkg.com/<%= repoName %>@<%= version %>/dist/<%= distName %>.js
[unpkg.com](https://unpkg.com) provides NPM-based CDN links. The above link will always point to the latest release on NPM. You can also use a specific version/tag via URLs like https://unpkg.com/<%= repoName %>@{{ $version }}/dist/<%= distName %>.js

Include <%= moduleName %> after Vue and it will install itself automatically:

Expand Down

0 comments on commit f36e526

Please sign in to comment.