WXL
3 天以前 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<template>
  <p>{{ $t('hello') }}</p>
</template>
 
<%_ if (lang === 'ts') { _%>
<script lang="ts">
<%_ if (!classComponent) { _%>
import Vue from 'vue'
 
export default Vue.extend({
  name: 'HelloI18n'
})
<%_ } else { _%>
import { Component, Vue } from 'vue-property-decorator'
 
@Component
export default class HelloI18n extends Vue {
}
<%_ } _%>
</script>
<%_ } else { _%>
<script>
export default {
  name: 'HelloI18n'
}
</script>
<%_ } _%>
 
<i18n>
{
  "en": {
    "hello": "Hello i18n in SFC!"
  }
}
</i18n>