This commit is contained in:
Claudio Dekker 2021-12-08 18:40:19 +01:00
parent e36216da50
commit 4636218aaa
No known key found for this signature in database
GPG Key ID: 6ACA8683E402B133
8 changed files with 24 additions and 44 deletions

View File

@ -57,16 +57,16 @@ export default {
data() {
return {
form: this.$inertia.form({
first_name: null,
last_name: null,
first_name: '',
last_name: '',
organization_id: null,
email: null,
phone: null,
address: null,
city: null,
region: null,
country: null,
postal_code: null,
email: '',
phone: '',
address: '',
city: '',
region: '',
country: '',
postal_code: '',
}),
}
},

View File

@ -1,5 +1,6 @@
<template>
<div>
<Head :title="`${form.first_name} ${form.last_name}`" />
<h1 class="mb-8 font-bold text-3xl">
<Link class="text-indigo-400 hover:text-indigo-600" href="/contacts">Contacts</Link>
<span class="text-indigo-400 font-medium">/</span>
@ -39,7 +40,7 @@
</template>
<script>
import { Link } from '@inertiajs/inertia-vue3'
import { Head, Link } from '@inertiajs/inertia-vue3'
import Layout from '@/Shared/Layout'
import TextInput from '@/Shared/TextInput'
import SelectInput from '@/Shared/SelectInput'
@ -47,12 +48,8 @@ import LoadingButton from '@/Shared/LoadingButton'
import TrashedMessage from '@/Shared/TrashedMessage'
export default {
metaInfo() {
return {
title: `${this.form.first_name} ${this.form.last_name}`,
}
},
components: {
Head,
Link,
LoadingButton,
SelectInput,

View File

@ -48,10 +48,10 @@ export default {
data() {
return {
form: this.$inertia.form({
first_name: null,
last_name: null,
email: null,
password: null,
first_name: '',
last_name: '',
email: '',
password: '',
owner: false,
photo: null,
}),

View File

@ -65,7 +65,7 @@ export default {
first_name: this.user.first_name,
last_name: this.user.last_name,
email: this.user.email,
password: null,
password: '',
owner: this.user.owner,
photo: null,
}),

View File

@ -1,7 +1,7 @@
<template>
<div :class="$class">
<div :class="$attrs.class">
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
<select :id="id" ref="input" v-model="selected" v-bind="$attrs" class="form-select" :class="{ error: error }">
<select :id="id" ref="input" v-model="selected" v-bind="{ ...$attrs, class: null }" class="form-select" :class="{ error: error }">
<slot />
</select>
<div v-if="error" class="form-error">{{ error }}</div>
@ -30,11 +30,6 @@ export default {
selected: this.modelValue,
}
},
computed: {
$class() {
return this.class
},
},
watch: {
selected(selected) {
this.$emit('update:modelValue', selected)

View File

@ -1,7 +1,7 @@
<template>
<div :class="$class">
<div :class="$attrs.class">
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
<input :id="id" ref="input" v-bind="$attrs" class="form-input" :class="{ error: error }" :type="type" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" />
<input :id="id" ref="input" v-bind="{ ...$attrs, class: null }" class="form-input" :class="{ error: error }" :type="type" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" />
<div v-if="error" class="form-error">{{ error }}</div>
</div>
</template>
@ -27,11 +27,6 @@ export default {
label: String,
modelValue: String,
},
computed: {
$class() {
return this.class
},
},
methods: {
focus() {
this.$refs.input.focus()

View File

@ -1,7 +1,7 @@
<template>
<div :class="$class">
<div :class="$attrs.class">
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
<textarea :id="id" ref="input" v-bind="$attrs" class="form-textarea" :class="{ error: error }" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" />
<textarea :id="id" ref="input" v-bind="{ ...$attrs, class: null }" class="form-textarea" :class="{ error: error }" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" />
<div v-if="error" class="form-error">{{ error }}</div>
</div>
</template>
@ -23,11 +23,6 @@ export default {
label: String,
modelValue: String,
},
computed: {
$class() {
return this.class
},
},
methods: {
focus() {
this.$refs.input.focus()

4
resources/js/app.js vendored
View File

@ -8,9 +8,7 @@ createInertiaApp({
resolve: name => require(`./Pages/${name}`),
title: title => `${title} - Ping CRM`,
setup({ el, App, props, plugin }) {
createApp({
render: () => h(App, props),
})
createApp({ render: () => h(App, props) })
.use(plugin)
.mount(el)
},