43 lines
744 B
JavaScript
43 lines
744 B
JavaScript
|
import {useIndex} from '../../composables/useIndex.js';
|
||
|
import SettingLayout from './Layout.vue';
|
||
|
|
||
|
export function useSettings(props) {
|
||
|
const {data, meta, router} = useIndex(props);
|
||
|
|
||
|
function submit() {
|
||
|
router.post(props.storeUrl, {...data.value});
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
submit,
|
||
|
data,
|
||
|
meta,
|
||
|
props,
|
||
|
SettingLayout,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
const props = {
|
||
|
data: {
|
||
|
type: Object,
|
||
|
required: true,
|
||
|
},
|
||
|
storeUrl: {
|
||
|
type: String,
|
||
|
required: true,
|
||
|
},
|
||
|
settingMenu: {
|
||
|
type: Object,
|
||
|
required: true,
|
||
|
},
|
||
|
meta: {
|
||
|
type: Object,
|
||
|
required: false,
|
||
|
default: () => {
|
||
|
return {};
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
|
||
|
export {props};
|