I'm looking to format my string so that it displays on multiple lines. I attempted to use replaceAll(",", "\n")
, but it didn't work as expected. Here's the code snippet:
<template>
<v-form>
<v-container>
<v-card
class="mt-15 pa-4 mx-auto"
max-width="1000"
multi-line>
{{consoleOutput.toString().replaceAll(",", "\n")}}
</v-card>
</v-container>
</v-form>
</template>
<script>
export default {
data: () => ({
consoleOutput: ["This", "should", "be", "on a ", "new Line "],
})
}
</script>
The current output is This should be on a new Line
. However, I want each string to be displayed on a separate line with an index in front of it (similar to console). It should look like this:
1. This
2. should
3. be
4. on a
5. new Line