apply debug changes

This commit is contained in:
mohadese namavar
2024-07-07 14:16:58 +04:30
parent cb86fa4278
commit c1762c0083
11 changed files with 321 additions and 210 deletions
+5 -1
View File
@@ -14,9 +14,13 @@
const { btns } = inject('init')
const product = inject('data')
const { dialog } = inject('service')
const token = useCookie('token')
const router = useRouter()
const handleClick = () => {
dialog.show(resolveComponent('ProductCommentDialogForm'), product)
if (token.value)
dialog.show(resolveComponent('ProductCommentDialogForm'), product)
else router.push('/auth/login')
}
</script>
+8 -3
View File
@@ -13,7 +13,7 @@
<component :is="item.is" ref="chips" :id="key" v-bind="item.props" v-model="form[key]" />
<label :for="key">{{ item.label }}</label>
<template v-if="['positive', 'negative'].includes(key)">
<Button icon="isax isax-add" severity="secondary" text @click="addChip(i)" />
<Button icon="isax isax-add" severity="secondary" text @click="addChip(key)" />
</template>
<small v-if="errors[key]">{{ errors[key] }}</small>
</li>
@@ -76,8 +76,9 @@ const submit = async () => {
}
const addChip = (i) => {
chips.value[i].addItem(new Event('keydown'), chips.value[i].$data.inputValue, true)
const addChip = (key) => {
const index = ['title', 'positive', 'negative'].indexOf(key)
chips.value[index]?.addItem(new Event('keydown'), chips.value[index].$data.inputValue, true)
}
const starsClass = (i) => (i > (form?.point || 0) ? 'opacity-25' : '')
@@ -158,6 +159,10 @@ watch(computed(() => form), (value, old) => {
.p-chips-token {
@apply ltr my-1;
.p-chips-token-label {
@apply font-vazir;
}
}
}
}