Recycle use v-for instructions.
v-for instructions need to be specified with site in sites special grammar of form sites is a source data array and site is an alias for the iteration of array elements.
Template You can also provide the second parameter as the key name: The third parameter is the index: We can process the elements of the array and then display them, and we can generally return the filtered or sorted array by creating a calculated attribute. Even numbers in the output array: The above examples are used together.
In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress. v-for can bind data to an array to render a list: 2.9.1.
v-for example ¶ <div id="app">
<ol>
<li v-for="site in sites">
{{ site.text }}
li>
ol>
div>
<script>
const app = {
data() {
return {
sites: [
{ text: 'Google' },
{ text: 'Runoob' },
{ text: 'Taobao' }
]
}
}
}
Vue.createApp(app).mount('#app')
script>
v-for an optional second parameter is also supported, whose value is theindex of the current item: 2.9.2.
v-for example ¶ index is the index value of the list item: <div id="app">
<ol>
<li v-for="(site, index) in sites">
{{ index }} -{{ site.text }}
li>
ol>
div>
<script>
const app = {
data() {
return {
sites: [
{ text: 'Google' },
{ text: 'Runoob' },
{ text: 'Taobao' }
]
}
}
}
Vue.createApp(app).mount('#app')
script>
for use in v-for : 2.9.3.
v-for ¶ <ul><templatev-for="site in sites"><li>{{ site.text
}}li><li>--------------li>template>ul>
v-for iterative object ¶ v-for can iterate over data through the properties of an object: 2.9.4.
v-for ¶ <divid="app"><ul><liv-for="value in object">{{ value
}}li>ul>div><script>const app = { data() { return { object: {
name: 'Rookie Tutorial', url: 'http://www.runoob.com', slogan:
'Learning is not only about technology, but also about dreams!' } } } }
Vue.createApp(app).mount('#app')script>
2.9.5.
v-for ¶ <divid="app"><ul><liv-for="(value, key) in object">{{ key }} : {{ value
}}li>ul>div>
2.9.6.
v-for ¶ <divid="app"><ul><liv-for="(value, key, index) in object">{{ index }}.
{{ key }} : {{ value }}li>ul>div>
v-for iterative integer ¶ v-for can also loop integers. 2.9.7.
v-for ¶ <divid="app"><ul><liv-for="n in 10">{{ n }}li>ul>div>
Show filtered / sorted results ¶
2.9.8.
v-for example ¶ <divid="app"><ul><liv-for="n in evenNumbers">{{ n }}li>ul>div>
v-for/v-if joint use ¶ v-for/v-if give select to set the default value: 2.9.9.
v-for/v-if example ¶ v-for loop out the list v-if set the selection value: <divid="app"><select@change="changeVal($event)"v-model="selOption"><templatev-for="(site,index)
in sites":site="site":index="index":key="site.id">
Principles, Technologies, and Methods of Geographic Information Systems
102
