Skip to content
代码片段 群组 项目
提交 a2c0d7fa 编辑于 作者: Paul Gascou-Vaillancourt's avatar Paul Gascou-Vaillancourt
浏览文件

Drop injects' default values

This removes default values from injected properties within the
`NotificationEmailListboxInput` component. Those were converted from
props to injects late in the initial implementation and the default
values had been preserved. However, it seems like an injected prop only
falls back to its default value if the property isn't provided at all.
If the property is provided but is `undefined`, that's used as the
prop's value, which caused an issue with the input's default value which
needs to be an empty string and not `undefined`.

Changelog: fixed
上级 1edd0b3e
No related branches found
No related tags found
无相关合并请求
......@@ -5,31 +5,7 @@ export default {
components: {
ListboxInput,
},
inject: {
label: {
from: 'label',
default: '',
},
name: {
from: 'name',
},
emails: {
from: 'emails',
default: () => [],
},
emptyValueText: {
from: 'emptyValueText',
required: true,
},
value: {
from: 'value',
default: '',
},
disabled: {
from: 'disabled',
default: false,
},
},
inject: ['label', 'name', 'emails', 'emptyValueText', 'value', 'disabled'],
data() {
return {
selected: this.value,
......
......@@ -10,7 +10,7 @@ const initNotificationEmailListboxInputs = () => {
const els = [...document.querySelectorAll('.js-notification-email-listbox-input')];
els.forEach((el, index) => {
const { label, name, emptyValueText, value } = el.dataset;
const { label, name, emptyValueText, value = '' } = el.dataset;
return new Vue({
el,
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册