index.js
30 lines
| 1 | export default { |
| 2 | namespaced: true, |
| 3 | state: () => ( |
| 4 | { |
| 5 | options: {}, |
| 6 | } |
| 7 | ), |
| 8 | getters: { |
| 9 | all: state => { |
| 10 | return state.options; |
| 11 | }, |
| 12 | footerHeading: state => { |
| 13 | return state.options?.footer_heading ?? true; |
| 14 | }, |
| 15 | isShowOverflow: state => { |
| 16 | return state.options?.show_overflow ?? false; |
| 17 | }, |
| 18 | showOverflowControl: state => { |
| 19 | return state.options.show_overflow_control ?? false; |
| 20 | }, |
| 21 | }, |
| 22 | mutations: { |
| 23 | insert( state, options ) { |
| 24 | state.options = options; |
| 25 | }, |
| 26 | toggleShowOverflow( state ) { |
| 27 | state.options.show_overflow = ! state.options.show_overflow; |
| 28 | }, |
| 29 | } |
| 30 | }; |