Skip to content

Commit 3501d21

Browse files
wip(tests): update for IE11 testing
1 parent 26373c6 commit 3501d21

File tree

1 file changed

+30
-34
lines changed

1 file changed

+30
-34
lines changed

test/vue2.html

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,47 @@
22
<html>
33
<body>
44
<div id="app"></div>
5-
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
6-
<script src="vue2-sfc-loader.js"></script>
5+
<script src="https://unpkg.com/vue@2/dist/vue.runtime.min.js"></script>
6+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue2-sfc-loader.js"></script>
77
<script>
88

99
/* <!-- */
1010
const config = {
1111
files: {
12-
'/app.vue': `
13-
<template>
14-
<span class="vue2">
15-
Hello World! {{ abc }}
16-
</span>
17-
</template>
18-
<style scoped>
19-
.vue2 {
20-
background: red
21-
}
22-
</style>
23-
<script>
24-
export default {
25-
data: {
26-
abc: "test"
27-
}
28-
}
29-
<\/script>
30-
`
12+
'/app.vue':
13+
' <template> '+
14+
' <div>{{ index }}</div> '+
15+
' </template> '+
16+
' <script> '+
17+
' '+
18+
' export default { '+
19+
' data() { '+
20+
' return { '+
21+
' index: 0, '+
22+
' } '+
23+
' }, '+
24+
' async mounted() { '+
25+
' '+
26+
' for ( ; this.index < 100; ++this.index ) '+
27+
' await new Promise(resolve => setTimeout(resolve, 1000)); '+
28+
' } '+
29+
' } '+
30+
' </script> '+
31+
'',
3132
}
3233
};
33-
/* --> */
34-
34+
3535
const options = {
3636
moduleCache: { vue: Vue },
37-
getFile: url => config.files[url],
38-
addStyle: (textContent) => {
39-
const style = Object.assign(document.createElement('style'), { textContent });
40-
const ref = document.head.getElementsByTagName('style')[0] || null;
41-
document.head.insertBefore(style, ref);
42-
},
37+
getFile: function(url) { return config.files[url] },
38+
addStyle: function () {},
4339
}
4440

45-
const asyncComponentFactory = window['vue2-sfc-loader'].loadModule('/app.vue', options)
46-
asyncComponentFactory.then((component) => {
47-
new Vue(component).$mount('#app')
48-
})
49-
41+
window['vue2-sfc-loader'].loadModule('/app.vue', options)
42+
.then(function(app) {
43+
new Vue(app).$mount('#app')
44+
});
45+
5046
</script>
5147
</body>
5248
</html>

0 commit comments

Comments
 (0)