The setup()
method is like an add-on to a regular component so we can just include it along with data, methods, etc.
function useSomething() {
// ...
}
const Component = {
setup() {
const { out1, out2 } = useSomething();
return { out1, out2 };
},
data: function () {
// ...
},
methods: {
// ...
},
}