array
" to define an array."/> array " to define an array.">Home >Web Front-end >Vue.js >How to represent arrays in vue.js
Arrays in vue.js are represented by single square brackets. The method of creating an array is: first create a code sample file; then pass the statement "f251896cc55feb04911e1d9bd4f7d248Array94b3e26ee717c64999d7867364b1b4a3" to define an array.
The operating environment of this tutorial: windows7 system, vue version 2.0, DELL G3 computer.
[Recommended related articles: vue.js]
Representation methods of strings, objects, and arrays in Vue.js
1. String It is double curly brackets {{ }}
2. The object is single curly brackets { }
3. The array is single square brackets [ ]
<div id="app"> <!--字符串--> <p :class="a">{{str}}</p> <!--对象--> <p :class="{aClass:isA,bClass:isB}">对象</p> <!--数组--> <p :class="['aClass','bClass']">数组</p> </div> <script type="text/javascript" src="../js/vue.js"></script> <script type="text/javascript"> const vm=new Vue({ el: '#app', data: { a: 'aClass', str: '字符串', isA: true, isB: false }, }) </script>
The above is the detailed content of How to represent arrays in vue.js. For more information, please follow other related articles on the PHP Chinese website!