mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-03 02:21:49 +08:00
fix: locale update bug (#611)
This commit is contained in:
parent
33e80d6e25
commit
8181a08cf4
@ -21,14 +21,14 @@
|
||||
:type="cancelButtonType"
|
||||
@click="cancel"
|
||||
>
|
||||
{{ cancelButtonText }}
|
||||
{{ cancelButtonText_ }}
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
:type="confirmButtonType"
|
||||
@click="confirm"
|
||||
>
|
||||
{{ confirmButtonText }}
|
||||
{{ confirmButtonText_ }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@ -39,7 +39,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent,ref } from 'vue'
|
||||
import { defineComponent, ref, computed } from 'vue'
|
||||
import { Button as ElButton } from '@element-plus/button'
|
||||
import { Popper as ElPopper } from '@element-plus/popper'
|
||||
import { t } from '../../locale'
|
||||
@ -58,11 +58,9 @@ export default defineComponent({
|
||||
},
|
||||
confirmButtonText: {
|
||||
type: String,
|
||||
default: t('el.popconfirm.confirmButtonText'),
|
||||
},
|
||||
cancelButtonText: {
|
||||
type: String,
|
||||
default: t('el.popconfirm.cancelButtonText'),
|
||||
},
|
||||
confirmButtonType: {
|
||||
type: String,
|
||||
@ -96,11 +94,18 @@ export default defineComponent({
|
||||
visible.value = false
|
||||
emit('cancel')
|
||||
}
|
||||
|
||||
const confirmButtonText_ = computed(() => {
|
||||
return props.confirmButtonText || t('el.popconfirm.confirmButtonText')
|
||||
})
|
||||
const cancelButtonText_ = computed(() => {
|
||||
return props.cancelButtonText || t('el.popconfirm.cancelButtonText')
|
||||
})
|
||||
return {
|
||||
visible,
|
||||
confirm,
|
||||
cancel,
|
||||
confirmButtonText_,
|
||||
cancelButtonText_,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
@ -239,7 +239,6 @@ export default defineComponent({
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: t('el.select.placeholder'),
|
||||
},
|
||||
defaultFirstOption: Boolean,
|
||||
reserveKeyword: Boolean,
|
||||
@ -342,7 +341,7 @@ export default defineComponent({
|
||||
}))
|
||||
|
||||
onMounted(() => {
|
||||
states.cachedPlaceHolder = currentPlaceholder.value = props.placeholder
|
||||
states.cachedPlaceHolder = currentPlaceholder.value = (props.placeholder || t('el.select.placeholder'))
|
||||
if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
|
||||
currentPlaceholder.value = ''
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user