「Javascript/vue/vuepress」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→カスタム変数用意) |
(→カスタム変数用意) |
||
(同じ利用者による、間の2版が非表示) | |||
行5: | 行5: | ||
設定ファイル | 設定ファイル | ||
.vuepress/config.js | .vuepress/config.js | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==カスタム変数用意== | ==カスタム変数用意== | ||
行21: | 行10: | ||
<pre> | <pre> | ||
const string = { | const string = { | ||
− | + | example: { | |
− | mail: "hoge@ | + | mail: "hoge@example.com" |
} | } | ||
} | } | ||
行44: | 行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@example.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}}'