docs: simplify $t to t

This commit is contained in:
chenjiahan
2020-03-21 14:46:02 +08:00
parent 10f32d6619
commit d8fa4b9495
80 changed files with 918 additions and 950 deletions

View File

@@ -1,44 +1,44 @@
<template>
<demo-section>
<demo-block :title="$t('basicUsage')">
<van-button type="danger" :text="$t('basicUsage')" @click="showNotify" />
<demo-block :title="t('basicUsage')">
<van-button type="danger" :text="t('basicUsage')" @click="showNotify" />
</demo-block>
<demo-block :title="$t('notifyType')">
<demo-block :title="t('notifyType')">
<div style="margin-bottom: 15px;">
<van-button
type="info"
:text="$t('primary')"
:text="t('primary')"
@click="showType('primary')"
/>
<van-button
type="primary"
:text="$t('success')"
:text="t('success')"
@click="showType('success')"
/>
</div>
<van-button
type="danger"
:text="$t('danger')"
:text="t('danger')"
@click="showType('danger')"
/>
<van-button
type="warning"
:text="$t('warning')"
:text="t('warning')"
@click="showType('warning')"
/>
</demo-block>
<demo-block :title="$t('customNotify')">
<demo-block :title="t('customNotify')">
<van-button
type="primary"
:text="$t('customColor')"
:text="t('customColor')"
@click="showCustomColor"
/>
<van-button
type="primary"
:text="$t('customDuration')"
:text="t('customDuration')"
@click="showCustomDuration"
/>
</demo-block>
@@ -74,12 +74,12 @@ export default {
methods: {
showNotify() {
this.$notify(this.$t('content'));
this.$notify(this.t('content'));
},
showCustomColor() {
this.$notify({
message: this.$t('customColor'),
message: this.t('customColor'),
color: '#ad0000',
background: '#ffe1e1',
});
@@ -87,14 +87,14 @@ export default {
showCustomDuration() {
this.$notify({
message: this.$t('customDuration'),
message: this.t('customDuration'),
duration: 1000,
});
},
showType(type) {
this.$notify({
message: this.$t('content'),
message: this.t('content'),
type,
});
},