add product image with url
This commit is contained in:
parent
44fa30fdc3
commit
ab73698a45
2 changed files with 21 additions and 1 deletions
|
|
@ -55,8 +55,16 @@
|
|||
></q-select>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<q-input
|
||||
v-if="productDialog.url"
|
||||
filled
|
||||
dense
|
||||
v-model.trim="productDialog.data.image"
|
||||
type="url"
|
||||
label="Image URL"
|
||||
></q-input>
|
||||
<q-file
|
||||
v-else
|
||||
class="q-pr-md"
|
||||
filled
|
||||
dense
|
||||
|
|
@ -79,6 +87,10 @@
|
|||
/>
|
||||
</template>
|
||||
</q-file>
|
||||
<q-toggle
|
||||
:label="`${productDialog.url ? 'Insert image URL' : 'Upload image file'}`"
|
||||
v-model="productDialog.url"
|
||||
></q-toggle>
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -498,6 +498,7 @@
|
|||
},
|
||||
productDialog: {
|
||||
show: false,
|
||||
url: true,
|
||||
data: {}
|
||||
},
|
||||
stallDialog: {
|
||||
|
|
@ -536,6 +537,9 @@
|
|||
methods: {
|
||||
resetDialog(dialog) {
|
||||
this[dialog].show = false
|
||||
if (dialog == 'productDialog') {
|
||||
this[dialog].url = true
|
||||
}
|
||||
this[dialog].data = {}
|
||||
},
|
||||
toggleDA(value, evt) {
|
||||
|
|
@ -801,8 +805,12 @@
|
|||
self.productDialog.data.categories = self.productDialog.data.categories.split(
|
||||
','
|
||||
)
|
||||
if (self.productDialog.data.image.startsWith('data:')) {
|
||||
self.productDialog.url = false
|
||||
}
|
||||
|
||||
self.productDialog.show = true
|
||||
console.log(self.productDialog)
|
||||
},
|
||||
sendProductFormData: function () {
|
||||
let _data = {...this.productDialog.data}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue