No puedo hacerlo. Espero que alguien pueda ayudarme con esto.
modus.value.getCurrentDataPath = sale.id (STRING)O
modus.value.getCurrentDataPath = id (STRING) En el siguiente ejemplo, quiero verificar si modus.value.getCurrentDataPath incluye un archivo . (punto) o no. Al final quiero crear un router.push{()}
const route1 = [] as any; if (modus.value.getCurrentDataPath.includes('.')) { const test = modus.value.getCurrentDataPath.split('.') let i; for (i = 0; i < test.length; i++) { route1.push(test[i]) } } else { route1.push(modus.value.getCurrentDataPath); } router.push({ path: route.path + '/' + getCurrent.value[route1] });Desafortunadamente esto no funciona. No puede leer las 2 cuerdas divididas.
Debería ser: getCurrent.value.sale.id
¿Cómo arreglar esto? Quiero que funcione para ambos. Con punto y sin punto. En un router.push.