<script>
import { ref } from 'vue'
setup(){
const whateverObject = ref({ prop: "whatever initial value" });
whateverObject.value.prop= "if you change something within setup you need to access it trough .value";
return { whateverObject } // expose it to the template by returning it
}
</script>
如果要使用类,请像我自己的示例中那样导入它们:
import { APIBroker } from '~/helpers/APIbroker'
const api = new APIBroker({})