Skip to content
代码片段 群组 项目
提交 b87671a1 编辑于 作者: Artur Fedorov's avatar Artur Fedorov 提交者: Jose Ivan Vargas
浏览文件

This MR fixes undefined in v-on handler

Vue 3 can not accept undefined. It was replaced
by empty object

Changelog: changed
EE: true
上级 e64c9505
No related branches found
No related tags found
无相关合并请求
......@@ -70,7 +70,7 @@ export default {
@fetch-suggestions="fetchTags"
v-on="$listeners"
>
<template #view-token="{ viewTokenProps: { listeners, inputValue, activeTokenValue } }">
<template #view-token="{ viewTokenProps: { listeners = {}, inputValue, activeTokenValue } }">
<gl-token variant="search-value" :class="$options.RUNNER_TAG_BG_CLASS" v-on="listeners">
{{ activeTokenValue ? activeTokenValue.text : inputValue }}
</gl-token>
......
......@@ -98,11 +98,11 @@ export default {
subscriptionHistory() {
return [...this.futureLicenseHistoryEntries, ...this.pastLicenseHistoryEntries];
},
},
created() {
this.$options.activationListeners = {
[SUBSCRIPTION_ACTIVATION_SUCCESS_EVENT]: this.displayActivationNotification,
};
activationListeners() {
return {
[SUBSCRIPTION_ACTIVATION_SUCCESS_EVENT]: this.displayActivationNotification,
};
},
},
methods: {
displayActivationNotification(license) {
......@@ -184,12 +184,12 @@ export default {
v-if="canShowSubscriptionDetails"
:subscription="currentSubscription"
:subscription-list="subscriptionHistory"
v-on="$options.activationListeners"
v-on="activationListeners"
/>
<no-active-subscription
v-else
:subscription-list="subscriptionHistory"
v-on="$options.activationListeners"
v-on="activationListeners"
/>
</div>
</template>
......@@ -35,11 +35,13 @@ export default {
error: null,
};
},
created() {
this.$options.activationListeners = {
[SUBSCRIPTION_ACTIVATION_FAILURE_EVENT]: this.handleActivationFailure,
[SUBSCRIPTION_ACTIVATION_SUCCESS_EVENT]: this.handleActivationSuccess,
};
computed: {
activationListeners() {
return {
[SUBSCRIPTION_ACTIVATION_FAILURE_EVENT]: this.handleActivationFailure,
[SUBSCRIPTION_ACTIVATION_SUCCESS_EVENT]: this.handleActivationSuccess,
};
},
},
methods: {
handleActivationFailure(error) {
......@@ -72,6 +74,6 @@ export default {
</template>
</gl-sprintf>
</p>
<subscription-activation-form class="gl-p-5" v-on="$options.activationListeners" />
<subscription-activation-form class="gl-p-5" v-on="activationListeners" />
</gl-card>
</template>
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册