Ich möchte mehrere Daten aus einem Array ohne Array-Index anzeigen, aber ich möchte es Daten jedes Mal im selben Format automatisch anzeigen, ohne li & Tabellen zu verwenden.So vereinfachen Sie diesen Code von VueJS
Mein Code:
<!DOCTYPE html>
<html>
\t <head>
\t <title>VueJS</title>
\t <meta charset="utf-8">
\t <meta name="viewport" content="width=device-width, initial-scale=1">
\t <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
\t <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
\t <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
\t </head>
\t
\t <body>
\t \t <div class="root">
\t \t \t <center>
\t \t \t <h1> {{names[0]}} </h1> <p> By <b>{{authors[0]}}</b> </p>
\t \t \t <p><b>{{dates[0]}}</b> in <b>{{language}}</b></p><hr>
\t \t \t <h1> {{names[1]}} </h1> <p> By <b>{{authors[1]}}</b> </p>
\t \t \t <p><b>{{dates[1]}}</b> in <b>{{language}}</b></p><hr>
\t \t \t <p>Update Any Changes You Want.</p>
\t \t \t <input type="text" id="text" v-model="names[0]"></input>
\t \t \t <input type="text" id="text" v-model="authors[0]"></input>
\t \t \t <input type="text" id="text" v-model="dates[0]"></input>
\t \t \t <input type="text" id="text" v-model="language"></input> </br> </br>
\t \t \t <input type="text" id="text" v-model="names[1]"></input>
\t \t \t <input type="text" id="text" v-model="authors[1]"></input>
\t \t \t <input type="text" id="text" v-model="dates[1]"></input>
\t \t \t <input type="text" id="text" v-model="language"></input></center><hr>
\t \t </div>
\t
\t
\t <script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
\t
\t <script>
\t \t new Vue ({
\t \t \t el: '.root',
\t \t \t data: book =
\t \t \t {
\t \t \t \t names: ['Hamlet', 'A Boys Will'],
\t \t \t \t authors: ['William Shakespeare', 'Robert Frost'],
\t \t \t \t dates: ['1609', '1913'],
\t \t \t \t language: 'English'
\t \t \t }
\t \t })
\t </script>
\t </body>
</html>
Right Now i-Array-Index verwende Werte von Array auszudrucken. Wie wird es am einfachsten sein, mehrere Werte anzuzeigen?
Danke.
Ehrfürchtig, Vielen Dank! –