Skip to content

Commit e1bc340

Browse files
committed
fix(actions-builder.js): some corrections for vuejs3
1 parent bb8d7ab commit e1bc340

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

tools/aceditor/presentation/javascripts/actions-builder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ window.myapp = createApp({
133133
// use a fake dom to parse wiki code attributes
134134
let fakeDom = $(`<${this.editor.currentSelectedAction}/>`)[0]
135135

136-
for(let attribute of fakeDom.attributes) Vue.set(this.values, attribute.name, attribute.value)
136+
for(let attribute of fakeDom.attributes) this.values[attribute.name] = attribute.value
137137

138138
let newActionId = fakeDom.tagName.toLowerCase()
139139
// backward compatibilty
@@ -166,7 +166,7 @@ window.myapp = createApp({
166166
this.selectedFormId = ''
167167
this.selectedActionId = ''
168168
// Bazar dynamic by default
169-
if (this.isBazarListeAction) Vue.set(this.values, "dynamic", true)
169+
if (this.isBazarListeAction) this.values.dynamic = true
170170
}
171171
this.updateActionParams()
172172
// If only one action available, select it
@@ -205,7 +205,7 @@ window.myapp = createApp({
205205
// Populate the values field from the config
206206
for(var propName in this.selectedAction.properties) {
207207
var configValue = this.selectedAction.properties[propName].value || this.selectedAction.properties[propName].default
208-
if (configValue && !this.values[propName]) Vue.set(this.values, propName, configValue)
208+
if (configValue && !this.values[propName]) this.values[propName] = configValue
209209
}
210210
if (this.isBazarListeAction && this.selectedAction.properties && this.selectedAction.properties.template) this.values.template = this.selectedAction.properties.template.value
211211
setTimeout(() => this.updateActionParams(), 0);

tools/aceditor/presentation/javascripts/components/InputColumnsWidth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default {
2222
<label v-if="config.label" class="control-label">{{ config.label }}</label>
2323
<div class="inline-form" v-for="element in elements">
2424
<template v-for="(property, propName) in config.subproperties">
25-
<component :is="componentIdFrom(property)" v-model="element[propName]"
25+
<component :is="componentIdFrom(property)" :value="element[propName]"
2626
v-show="checkVisibility(property)" :name="propName" :values="values"
2727
:config="property" :selected-form="selectedForm">
2828
</component>

tools/aceditor/presentation/javascripts/components/InputFormField.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,30 @@ export default {
2020
}
2121
},
2222
watch: {
23-
fields() {
24-
this.$emit('input', this.fields.map(f => f.id).join(','))
25-
},
23+
fields: {
24+
handler(val, oldVal) {
25+
this.$emit('input', this.fields.map(f => f.id).join(','))
26+
},
27+
deep: true // to force following mutations
28+
}
2629
},
2730
template: `
2831
<div class="form-group" :class="config.type" :title="config.hint" >
2932
<label v-if="config.label" class="control-label">{{ config.label }}</label>
3033
31-
<v-select v-if="config.multiple" v-model="fields" :options="fieldOptions" label="id" :multiple="true">
34+
<v-select v-if="config.multiple" v-model:value="fields" :options="fieldOptions" label="id" :multiple="true">
3235
<template v-slot:option="option">
3336
<span v-html="option.label"></span> - {{ option.id }}
3437
</template>
3538
</v-select>
3639
3740
<select v-else :value="value" v-on:input="$emit('input', $event.target.value)" class="form-control">
3841
<option value=""></option>
39-
<option v-for="field in fieldOptions" v-if="field.label" :value="field.id">
40-
<span v-html="field.label"></span> - {{ field.id }}
41-
</option>
42+
<template v-for="field in fieldOptions">
43+
<option v-if="field.label" :value="field.id">
44+
<span v-html="field.label"></span> - {{ field.id }}
45+
</option>
46+
</template>
4247
</select>
4348
4449
<input-hint :config="config"></input-hint>

tools/aceditor/presentation/javascripts/components/InputMultiInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
<div class="multi-input-container" :class="name">
5454
<div class="inline-form" v-for="element in elements">
5555
<template v-for="(property, propName) in config.subproperties">
56-
<component :is="componentIdFrom(property)" v-model="element[propName]"
56+
<component :is="componentIdFrom(property)" :value="element[propName]"
5757
v-show="checkVisibility(property)" :name="propName" :values="values"
5858
:config="property" :selected-form="selectedForm">
5959
</component>

0 commit comments

Comments
 (0)