Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template id="mytemplate">
- <div>
- <form @submit.prevent="onFormSubmit">
- username <input v-model="username" />
- password <input v-model="password" />
- <button type="submit">Login</button>
- </form>
- </div>
- </template>
- kiwi.plugin('my_plugin', function(kiwi) {
- kiwi.addView('myloginview', {
- template: '#mytemplate',
- data: function() {
- return {
- username: '',
- password: '',
- };
- },
- methods: {
- onFormSubmit: function(event) {
- var network = kiwi.state.getActiveNetwork();
- // ... do login stuff here
- },
- },
- });
- // when something happens then do this
- function showLoginForm() {
- kiwi.showView('myloginview');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement