mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 11:54:02 +00:00
docs: simplify $t to t
This commit is contained in:
@@ -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,
|
||||
});
|
||||
},
|
||||
|
Reference in New Issue
Block a user