Created
January 13, 2022 20:12
-
-
Save cn-2k/249f41596b9cbe18f4c6e88e00d48bcf to your computer and use it in GitHub Desktop.
Vue 3 toRefs in script setup use case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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