Skip to content

Commit

Permalink
Pass field to detail field value component
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarpsvo committed Nov 13, 2019
1 parent 11f7695 commit 311d5c2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ You can then edit the strings to your liking.

You can overwrite the detail view value component to customize it as you see fit.

Create a new component for `NovaMultiselectDetailFieldValue` and register it in your `app.js`. It accepts one prop, `values`, which is an array of the selected labels.
Create a new component for `NovaMultiselectDetailFieldValue` and register it in your `app.js`. The component receives two props: `field` and `values`. The `values` prop is an array of selected labels.

```js
// in NovaMultiselectDetailFieldValue.vue
Expand All @@ -114,7 +114,7 @@ Create a new component for `NovaMultiselectDetailFieldValue` and register it in

<script>
export default {
props: ['values'],
props: ['field', 'values'],
};
</script>
```
Expand Down
2 changes: 1 addition & 1 deletion dist/js/multiselect-field.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/js/components/DetailField.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<panel-item :field="field">
<template slot="value">
<nova-multiselect-detail-field-value v-if="isMultiselect" :values="values" />
<nova-multiselect-detail-field-value v-if="isMultiselect" :field="field" :values="values" />

<div v-else>
{{ (value && value.label) || '' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@

<script>
export default {
props: ['values'],
props: ['field', 'values'],
};
</script>

0 comments on commit 311d5c2

Please sign in to comment.