generated from Seekra/repository-template
Feat(settings): add renderer for settings configuration #142
@@ -38,6 +38,8 @@ const store = useSettingsStore();
|
|||||||
const inputModel = ref(store.get(props.path));
|
const inputModel = ref(store.get(props.path));
|
||||||
let oldInputValue = inputModel.value;
|
let oldInputValue = inputModel.value;
|
||||||
|
|
||||||
|
const doneButtonInitial = ref(true);
|
||||||
|
|
||||||
const inputId = useId();
|
const inputId = useId();
|
||||||
const inputLabelId = useId();
|
const inputLabelId = useId();
|
||||||
|
|
||||||
@@ -59,6 +61,10 @@ watch(store, (newValue) => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(inputModel, () => {
|
||||||
|
doneButtonInitial.value = false;
|
||||||
|
});
|
||||||
|
|
||||||
const apply = function apply () {
|
const apply = function apply () {
|
||||||
store.set(props.path, inputModel.value);
|
store.set(props.path, inputModel.value);
|
||||||
};
|
};
|
||||||
@@ -82,7 +88,9 @@ const apply = function apply () {
|
|||||||
class="input"
|
class="input"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
|
ref="doneButton"
|
||||||
class="done-button button"
|
class="done-button button"
|
||||||
|
:class="{ initial: doneButtonInitial }"
|
||||||
type="submit"
|
type="submit"
|
||||||
:title="t('settings.input.done.title')"
|
:title="t('settings.input.done.title')"
|
||||||
:aria-label="t('settings.input.done.ariaLabel')"
|
:aria-label="t('settings.input.done.ariaLabel')"
|
||||||
@@ -141,6 +149,9 @@ const apply = function apply () {
|
|||||||
border-radius: calc(var(--input-padding) + 13px);
|
border-radius: calc(var(--input-padding) + 13px);
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.done-button:not(.initial) {
|
||||||
animation: done-button-disappear var(--total-animation-duration);
|
animation: done-button-disappear var(--total-animation-duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user