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
<script src="https://cdn.jsdelivr.net/npm/vue"></script> | |
<div id="app"> | |
<h1>{{ $t('welcome-message') }}</h1> | |
<button @click="changeLang('en')">English</button> | |
<button @click="changeLang('zh')">中文</button> | |
<button @click="changeLang('nl')">Dutch</button> | |
</div> | |
<script> |
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
<script src="https://cdn.jsdelivr.net/npm/vue"></script> | |
<div id="app"> | |
<form @submit="validate"> | |
<input v-model="text"> | |
<br> | |
<input v-model="email"> | |
<ul v-if="!$v.valid" style="color:red"> | |
<li v-for="error in $v.errors"> |
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
<script src="https://cdn.jsdelivr.net/npm/vue"></script> | |
<script src="./path-to-regexp.js"></script> | |
<div id="app"></div> | |
<script> | |
// '#/foo/123' -> foo with id: 123 | |
// '#/bar' -> Bar | |
// '#/404' -> NotFound |
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
<script src="https://cdn.jsdelivr.net/npm/vue"></script> | |
<div id="app"> | |
<!-- render main view here --> | |
<a href="#foo">foo</a> | |
<a href="#bar">bar</a> | |
</div> | |
<script> | |
// '#/foo' -> Foo |
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
<script src="https://cdn.jsdelivr.net/npm/vue"></script> | |
<div id="app"> | |
<!-- render main view here --> | |
<component :is="url"></component> | |
<a href="#foo">foo</a> | |
<a href="#bar">bar</a> | |
</div> | |
<script> |
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
<script src="https://cdn.jsdelivr.net/npm/vue"></script> | |
<div id="app"></div> | |
<script> | |
function app({ el, model, view, actions }) { | |
// Implement this! | |
const wrappedActions = {} | |
Object.keys(actions).forEach(key => { |
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
<script src="https://cdn.jsdelivr.net/npm/vue"></script> | |
<div id="app"> | |
<counter></counter> | |
<counter></counter> | |
<counter></counter> | |
<button @click="inc">increment</button> | |
</div> | |
<script> |
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
<script src="https://cdn.jsdelivr.net/npm/vue"></script> | |
<div id="app"> | |
<counter :count="count"></counter> | |
<counter :count="count"></counter> | |
<counter :count="count"></counter> | |
<button @click="count++">increment</button> | |
</div> | |
<script> |
NewerOlder