Confirm delete button becomes enabled if item name matches the input text
This commit is contained in:
parent
51aeb7629f
commit
08349b68e8
|
@ -27,6 +27,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="viewState==='Success'">
|
<div v-else-if="viewState==='Success'">
|
||||||
<h1>SUCCESS you can now close this popup</h1>
|
<h1>SUCCESS you can now close this popup</h1>
|
||||||
|
<h1>{{ item._id }}</h1>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="viewState==='Error'">
|
<div v-else-if="viewState==='Error'">
|
||||||
<h1>ERROR please try again, if the error persist contact Chadmin!</h1>
|
<h1>ERROR please try again, if the error persist contact Chadmin!</h1>
|
||||||
|
@ -57,9 +58,18 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
input: '',
|
viewState: 'initialState',
|
||||||
isNameCorrect: false,
|
isNameCorrect: true,
|
||||||
viewState: 'initialState'
|
input: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
input: function() {
|
||||||
|
if (this.input === this.item.name) {
|
||||||
|
this.isNameCorrect = false
|
||||||
|
} else {
|
||||||
|
this.isNameCorrect = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -71,8 +81,6 @@ export default {
|
||||||
return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
|
return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
console.log(this.input)
|
|
||||||
console.log(this.item._id)
|
|
||||||
if (this.input) {
|
if (this.input) {
|
||||||
this.viewState = 'Success'
|
this.viewState = 'Success'
|
||||||
} else if (!this.input) {
|
} else if (!this.input) {
|
||||||
|
|
Loading…
Reference in New Issue