「Javascript/vue/vuepress」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→バージョンなどを記述) |
(→カスタム変数用意) |
||
| 行10: | 行10: | ||
<pre> | <pre> | ||
const string = { | const string = { | ||
| − | + | example: { | |
mail: "hoge@gmail.com" | mail: "hoge@gmail.com" | ||
} | } | ||
| 行33: | 行33: | ||
Vue.mixin(strings); | Vue.mixin(strings); | ||
} | } | ||
| + | </pre> | ||
| + | |||
| + | |||
| + | example1.md | ||
| + | <pre> | ||
| + | ver:{{$string.example.,mail}}' | ||
</pre> | </pre> | ||
==参考== | ==参考== | ||
https://qiita.com/dojineko/items/aae7e6d13479e08d49fd | https://qiita.com/dojineko/items/aae7e6d13479e08d49fd | ||
2019年4月12日 (金) 13:22時点における版
vuepressとは
Markdownのドキュメントジェネレーター
サイトデザインなど変更
設定ファイル
.vuepress/config.js
カスタム変数用意
.vuepress/scripts/string.js
const string = {
example: {
mail: "hoge@gmail.com"
}
}
export default {
computed: {
$string () {
return string
}
}
}
.vuepress/enhanceApp.js
import strings from "./scripts/string"
export default ({
Vue,
options,
router,
siteData
}) => {
Vue.mixin(strings);
}
example1.md
ver:{{$string.example.,mail}}'
