<div v-show="isShowDownloadLog" @click="downloadSetInformation" class="button" <i…
- User
const isShowDownloadLog = computed(() => { const { status } = unref(set) return ( status === 'ERROR' || status === 'WARNING' || status === 'MIGRATING' || status === 'POST MIGRATING' || status === 'MIGRATED' || status === 'ABORTED' || status === 'UNKNOWN' || status === 'CONFIGURED' || status === 'PART CONFIGURED' ) })
codeconst isReady = computed(() => { return unref(set).status === 'CONFIGURED' || unref(set).status === 'PART CONFIGURED' })переименовать кнопку "set.downloadLog" на "Скачать журнал миграции" для статусов isReady,а для остальных оставить предыдущий вариант
- Assistant
To achieve the functionality where the button label changes based on the
isReadystatus, you'll need to use a computed property that checks the current status of the set and returns the appropriate label. Here's how you can implement it:javascriptconst downloadLogLabel = computed(() => { const status = unref(set).status; if (status === 'CONFIGURED' || status === 'PART CONFIGURED') { return 'Скачать журнал миграции'; } return $t('set.downloadLog'); });Then, use this computed property in your template to update the button label dynamically:
html<div v-show="isShowDownloadLog" @click="downloadSetInformation" class="button" > <i class="el-icon-download"></i> {{ downloadLogLabel }} </div>In this implementation, the
downloadLogLabelcomputed property determines whether the button should display "Скачать журнал миграции" or the default translation based on the status of theset.