Skip to content

Instantly share code, notes, and snippets.

@cn-2k
Created January 13, 2022 20:12
Show Gist options
  • Save cn-2k/249f41596b9cbe18f4c6e88e00d48bcf to your computer and use it in GitHub Desktop.
Save cn-2k/249f41596b9cbe18f4c6e88e00d48bcf to your computer and use it in GitHub Desktop.
Vue 3 toRefs in script setup use case
const searchEntities = ref('')
const searchActions = ref('')
const loadingTable = ref(false)
const loadingRegister = ref(false)
const singleTable = ref(null)
const newEntity = ref(false)
const entityName = ref('')
const newAction = ref(false)
const actionName = ref('')
// or
// const state = reactive({
// searchEntities: '',
// searchActions: '',
// loadingTable: false,
// loadingRegister: false,
// singleTable: null,
// newEntity: false,
// entityName: '',
// newAction: false,
// actionName: ''
// })
// const params = toRefs(state)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment