D
D
Dmitry2021-09-20 22:23:49
Vue.js
Dmitry, 2021-09-20 22:23:49

How to implement OOP on VUE?

Hello. I wrote a training application in js that scans the network for open websocket connections, receives data and visualizes them. It works like this: the network is scanned, if there is an open websocket connection c readyState === 1, an instance of the class is created CreateDataCardin this instance, an instance of the class is created CreateViewCard. Well, at the output we get as many cards with data as there are open websocket connections, and, accordingly, each card has its own data and its own representation. How to implement the same in Vue? After all, Vue has one datafor the entire application.

Answer the question

In order to leave comments, you need to log in

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

data of the main Vue instance will contain an array of data objects of discovered sockets.
From this array, render a list of socket view components.
Understand components in Vue . Although it may be possible to get by with just the lines of an HTML list.
A good hackneyed example for a similar task - Todo App

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question