|
@@ -46,15 +46,19 @@ export default {
|
|
|
handler (newValue) {
|
|
handler (newValue) {
|
|
|
if (newValue.length > 0 && newValue[0].id) {
|
|
if (newValue.length > 0 && newValue[0].id) {
|
|
|
this.selectedContents = (new ContentList(JSON.parse(JSON.stringify(newValue)))).list
|
|
this.selectedContents = (new ContentList(JSON.parse(JSON.stringify(newValue)))).list
|
|
|
|
|
+ this.emitSelectedContents()
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
immediate: true
|
|
immediate: true
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- onSelectContent () {
|
|
|
|
|
|
|
+ emitSelectedContents () {
|
|
|
this.$emit('update:value', this.selectedContents.map(item => item.id))
|
|
this.$emit('update:value', this.selectedContents.map(item => item.id))
|
|
|
},
|
|
},
|
|
|
|
|
+ onSelectContent () {
|
|
|
|
|
+ this.emitSelectedContents()
|
|
|
|
|
+ },
|
|
|
onView (content) {
|
|
onView (content) {
|
|
|
const routeData = this.$router.resolve({ name: 'Admin.Content.Show', params: { id: content.id } })
|
|
const routeData = this.$router.resolve({ name: 'Admin.Content.Show', params: { id: content.id } })
|
|
|
window.open(routeData.href, '_blank')
|
|
window.open(routeData.href, '_blank')
|
|
@@ -68,7 +72,7 @@ export default {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
this.selectedContents.splice(contentIndex, 1)
|
|
this.selectedContents.splice(contentIndex, 1)
|
|
|
- this.$emit('update:value', this.selectedContents.map(item => item.id))
|
|
|
|
|
|
|
+ this.emitSelectedContents()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|