0
votes

The documentation says this is possible but there's no example showing how. How would one go about it?

1

1 Answers

0
votes

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: {
    // ...
  },
}