|
7 | 7 | <vu:content><span class="sr-only" th:if="${label==null}" vu:text="${title?:''}"></span></vu:content>
|
8 | 8 | </q-btn>
|
9 | 9 | </th:block>
|
10 |
| -<th:block th:fragment="button-submit-confirm(actions_slot, label, icon, color, text-color, action, title, loading, formId, confirmMessage, labelOk, labelCancel, other_attrs)" |
| 10 | +<th:block th:fragment="button-submit-confirm(actions_slot, key, label, icon, color, text-color, action, title, loading, formId, confirmMessage, labelOk, labelCancel, other_attrs)" |
11 | 11 | th:assert="(${label} != null or (${icon} != null and ${title} != null)) and ${action} != null and ${formId} != null"
|
12 |
| - th:with="myComponentId='button'+${action},myLabelOk=${labelOk?:'Oui'},myLabelCancel=${labelCancel?:'Non'}, myLoading=${loading}?:true" |
13 |
| - th:attr="objectKey=${model.vContext['componentStates'].addComponentState(myComponentId).addPrimitive('confirm',false)}"> |
| 12 | + th:with="myComponentId=${model.util.generateComponentUID('button', action, null, null)}, |
| 13 | + myKey=${key?:'(props?.rowIndex || ``)'}, |
| 14 | + myLabelOk=${labelOk?:'Oui'}, |
| 15 | + myLabelCancel=${labelCancel?:'Non'}, |
| 16 | + myLoading=${loading}?:true"> |
14 | 17 | <q-btn th:icon="${icon?:''}" th:label="${label?:''}" th:title="${title?:''}"
|
15 |
| - th:@click="|componentStates.${myComponentId}.confirm = true|" |
| 18 | + th:@click="|$refs['${myComponentId}'+ ${myKey}].show()|" |
16 | 19 | th::round="${label==null?'true':''}" th:color="${color?:'primary'}" th:text-color="${textColor?:''}" th:attr="__${other_attrs}__">
|
17 | 20 | <span class="sr-only" th:if="${label==null}" vu:text="${title?:''}"></span>
|
18 |
| - <q-dialog th:v-model="|componentStates.${myComponentId}.confirm|" persistent> |
| 21 | + <q-dialog th::ref="|'${myComponentId}' + ${myKey}|" persistent> |
19 | 22 | <q-card>
|
20 | 23 | <q-card-section class="row items-center">
|
21 | 24 | <vu:content>
|
22 |
| - <span class="q-ml-sm" vu:text="${confirmMessage}"></span> |
| 25 | + <span class="q-ml-sm" vu:text="${confirmMessage}"></span> |
23 | 26 | </vu:content>
|
24 | 27 | </q-card-section>
|
25 | 28 | <q-card-actions align="right" vu:slot="actions_slot">
|
|
0 commit comments