-
-
Notifications
You must be signed in to change notification settings - Fork 861
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…vondet * Vue slots syntax for interpolation w/ tests * 👕 refactor: slot component interpolation * 👕 refactor: component interpolation tests * 🍭 examples(interpolation): add slots usage example * 🆙 update(interpolation): tweak warning messages * 📝 docs(vuepress): update component interplation docs
- Loading branch information
Showing
7 changed files
with
299 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>component interpolation</title> | ||
<script src="../../../node_modules/vue/dist/vue.min.js"></script> | ||
<script src="../../../dist/vue-i18n.min.js"></script> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
<form> | ||
<div class="usernam"> | ||
<label for="username">username:</label> | ||
<input id="username" type="text" value="username"> | ||
</div> | ||
<div class="email"> | ||
<label for="email">email:</label> | ||
<input id="email" type="text" value="[email protected]"> | ||
</div> | ||
<div class="agreement"> | ||
<input id="tos" type="checkbox"> | ||
<i18n path="term" tag="label" for="tos"> | ||
<a slot="tos" :href="url" target="_blank">{{ $t('tos') }}</a> | ||
</i18n> | ||
</div> | ||
<input type="submit" value="submit"> | ||
</form> | ||
</div> | ||
<script> | ||
var messages = { | ||
en: { | ||
tos: 'Term of Service', | ||
term: 'I accept xxx {tos}.' | ||
}, | ||
ja: { | ||
tos: '利用規約', | ||
term: '私は xxx の{tos}に同意します。' | ||
} | ||
} | ||
|
||
Vue.use(VueI18n) | ||
|
||
var i18n = new VueI18n({ | ||
locale: 'en', | ||
messages: messages | ||
}) | ||
new Vue({ | ||
i18n: i18n, | ||
data: { | ||
url: '/term' | ||
} | ||
}).$mount('#app') | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.