return a Promise from goto - fixes #270

This commit is contained in:
Rich Harris
2018-06-27 17:32:20 -04:00
parent f821c19528
commit 57eeb5659a
3 changed files with 15 additions and 7 deletions

View File

@@ -6,15 +6,21 @@
<p>This is the 'about' page. There's not much here.</p>
<button class='goto' on:click='goto("blog/what-is-sapper")'>What is Sapper?</button>
<button class='prefetch' on:click='prefetch("blog/why-the-name")'>Why the name?</button>
<script>
import { goto, prefetch } from '../../../runtime.js';
export default {
oncreate() {
window.goto = goto;
},
ondestroy() {
window.goto = null;
},
methods: {
goto,
prefetch
}
};