Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Commit c41aa13

Browse files
committed
📝 docs(examples): update examples
1 parent b05e0e6 commit c41aa13

File tree

9 files changed

+62
-8
lines changed

9 files changed

+62
-8
lines changed

examples/formatting/html/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
<script src="../../../dist/vue-i18n.min.js"></script>
88
</head>
99
<body>
10-
<p>{{{ $t('message.hello') }}}</p>
10+
<div id="app">
11+
<p v-html="$t('message.hello')"></p>
12+
</div>
1113
<script>
1214
var locales = {
1315
en: {
@@ -20,7 +22,7 @@
2022
Vue.use(VueI18n)
2123
Vue.locale('en', locales['en'])
2224

23-
new Vue({ el: 'body' })
25+
new Vue({ el: '#app' })
2426
</script>
2527
</body>
2628
</html>

examples/formatting/list/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
<script src="../../../dist/vue-i18n.min.js"></script>
88
</head>
99
<body>
10-
<p>{{ $t('message.hello', ["hello"]) }}</p>
10+
<div id="app">
11+
<p>{{ $t('message.hello', ["hello"]) }}</p>
12+
</div>
1113
<script>
1214
var locales = {
1315
en: {
@@ -20,7 +22,7 @@
2022
Vue.use(VueI18n)
2123
Vue.locale('en', locales['en'])
2224

23-
new Vue({ el: 'body' })
25+
new Vue({ el: '#app' })
2426
</script>
2527
</body>
2628
</html>

examples/formatting/named/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
<script src="../../../dist/vue-i18n.min.js"></script>
88
</head>
99
<body>
10-
<p>{{ $t('message.hello', { msg: "hello"}) }}</p>
10+
<div id="app">
11+
<p>{{ $t('message.hello', { msg: "hello"}) }}</p>
12+
</div>
1113
<script>
1214
var locales = {
1315
en: {
@@ -20,7 +22,7 @@
2022
Vue.use(VueI18n)
2123
Vue.locale('en', locales['en'])
2224

23-
new Vue({ el: 'body' })
25+
new Vue({ el: '#app' })
2426
</script>
2527
</body>
2628
</html>

examples/formatting/rails/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
<script src="../../../dist/vue-i18n.min.js"></script>
88
</head>
99
<body>
10-
<p>{{ $t('message.hello', { msg: "hello"}) }}</p>
10+
<div id="app">
11+
<p>{{ $t('message.hello', { msg: "hello"}) }}</p>
12+
</div>
1113
<script>
1214
var locales = {
1315
en: {
@@ -20,7 +22,7 @@
2022
Vue.use(VueI18n)
2123
Vue.locale('en', locales['en'])
2224

23-
new Vue({ el: 'body' })
25+
new Vue({ el: '#app' })
2426
</script>
2527
</body>
2628
</html>

test/e2e/test/component.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
component: function (browser) {
3+
browser
4+
.url('http://localhost:8080/examples/component/')
5+
.waitForElementVisible('#app', 1000)
6+
.assert.containsText('p:nth-child(1)', 'こんにちは、世界')
7+
.assert.containsText('p:nth-child(2)', 'component1 local: こんにちは、component1')
8+
.end()
9+
}
10+
}

test/e2e/test/formatting_html.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
'formatting html': function (browser) {
3+
browser
4+
.url('http://localhost:8080/examples/formatting/html/')
5+
.waitForElementVisible('#app', 1000)
6+
.assert.attributeContains('p', 'innerHTML', '')
7+
.end()
8+
}
9+
}

test/e2e/test/formatting_list.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
'formatting list': function (browser) {
3+
browser
4+
.url('http://localhost:8080/examples/formatting/list/')
5+
.waitForElementVisible('#app', 1000)
6+
.assert.containsText('p', 'hello world')
7+
.end()
8+
}
9+
}

test/e2e/test/formatting_named.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
'formatting name': function (browser) {
3+
browser
4+
.url('http://localhost:8080/examples/formatting/named/')
5+
.waitForElementVisible('#app', 1000)
6+
.assert.containsText('p', 'hello world')
7+
.end()
8+
}
9+
}

test/e2e/test/formatting_rails.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
'formatting rails': function (browser) {
3+
browser
4+
.url('http://localhost:8080/examples/formatting/rails/')
5+
.waitForElementVisible('#app', 1000)
6+
.assert.containsText('p', 'hello world')
7+
.end()
8+
}
9+
}

0 commit comments

Comments
 (0)