Skip to content

Commit 7a45795

Browse files
committed
refactor(desk): add i-value placeholder
1 parent 66f368b commit 7a45795

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

packages/desktop/components/is-input.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ onMounted(() => {
183183
:placeholder="placeholder"
184184
:readonly="readonly"
185185
v-bind="bindings.input"
186-
class="bg-transparent outline-none grow max-w-full"
186+
class="bg-transparent outline-none grow max-w-full placeholder:text-t-secondary/50"
187187
@focus="onFocus"
188188
@blur="onBlur"
189189
/>

packages/desktop/modules/item/components/IValue.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,21 @@ function upload() {
148148
</script>
149149

150150
<template>
151-
<is-input v-if="column.type === 'number'" v-model="model" flat type="number" class="w-full" />
151+
<is-input
152+
v-if="column.type === 'number'"
153+
v-model="model"
154+
:placeholder="column.label"
155+
flat
156+
type="number"
157+
class="w-full"
158+
/>
152159

153160
<is-select
154161
v-else-if="column.type === 'select'"
155162
v-model="model"
156163
:options="select.options"
157164
flat
165+
:placeholder="column.label"
158166
/>
159167

160168
<v-dialog v-else-if="column.type === 'script'">
@@ -165,6 +173,7 @@ function upload() {
165173
readonly
166174
flat
167175
input:class="cursor-pointer w-full"
176+
:placeholder="column.label"
168177
/>
169178
</template>
170179

@@ -182,6 +191,7 @@ function upload() {
182191
v-model="model"
183192
:label-key="column.displayField"
184193
:options="relation.items"
194+
:placeholder="column.label"
185195
return-object
186196
value-key="id"
187197
flat
@@ -213,7 +223,7 @@ function upload() {
213223
</div>
214224
</template>
215225

216-
<is-input v-else-if="column.type === 'text'" v-model="model" flat />
226+
<is-input v-else-if="column.type === 'text'" v-model="model" flat :placeholder="column.label" />
217227

218228
<div v-else class="text-danger px-4 py-2">
219229
{{ $t('errors.unknown') }}

packages/desktop/modules/item/store.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const useStore = defineStore('item', () => {
2020

2121
const items = ref<StoreItems[]>([])
2222

23-
async function setItems(collectionId: string) {
23+
async function setItems(collectionId: string, forceUpdate = false) {
2424
let storeItem = items.value.find((i) => i.collectionId === collectionId)
2525

2626
if (!storeItem) {
@@ -33,6 +33,8 @@ export const useStore = defineStore('item', () => {
3333
items.value.push(storeItem)
3434
}
3535

36+
if (!forceUpdate && storeItem.items.length) return
37+
3638
storeItem.loading = true
3739

3840
const raw: Item[] = await useCase('list-items', {

0 commit comments

Comments
 (0)