D
D
domi13242021-09-20 01:15:18
Vue.js
domi1324, 2021-09-20 01:15:18

Where to put an object with methods when using Vue?

hello i want to do

<div class="textmessage">
          {{
            LiteStringPaser.parseColor(
              LiteStringPaser.parseLineBreak(myText)
            )
          }}

where I implement the LiteStringPaser object myself, but where to put the LiteStringPaser implementation - it will not start in data, in
methods: {
    LiteStringParser: {
      parseLineBreak(str) {
        return str;
      },
      parseColor(str) {
        return str;
      },
    },
  },
doesn't work either

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2021-09-20
@domi1324

{{ myComputed }}


// ...
  computed: {
    myComputed() {
      return Lightparser.spaghetti();
    },
  },

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question