docs(Empty): use composition api

This commit is contained in:
chenjiahan 2020-12-13 14:03:37 +08:00
parent 668a7fbf5f
commit 7537370343

View File

@ -34,32 +34,39 @@
</demo-block> </demo-block>
</template> </template>
<script> <script lang="ts">
export default { import { ref } from 'vue';
i18n: { import { useTranslate } from '@demo/use-translate';
'zh-CN': {
error: '通用错误', const i18n = {
search: '搜索提示', 'zh-CN': {
network: '网络错误', error: '通用错误',
imageType: '图片类型', search: '搜索提示',
description: '描述文字', network: '网络错误',
customImage: '自定义图片', imageType: '图片类型',
bottomContent: '底部内容', description: '描述文字',
}, customImage: '自定义图片',
'en-US': { bottomContent: '底部内容',
error: 'Error', },
search: 'Search', 'en-US': {
network: 'Network', error: 'Error',
imageType: 'Image Type', search: 'Search',
description: 'Description', network: 'Network',
customImage: 'Custom Image', imageType: 'Image Type',
bottomContent: 'Bottom Content', description: 'Description',
}, customImage: 'Custom Image',
}, bottomContent: 'Bottom Content',
},
};
export default {
setup() {
const t = useTranslate(i18n);
const active = ref('error');
data() {
return { return {
active: 'error', t,
active,
}; };
}, },
}; };