Detailed explanation of Vue development Sort component code

Detailed explanation of Vue development Sort component code
<template>
	<ul class="container">
		<li v-for="(item,index) in datalist" :key="index">
			{{item.text}}<span></span>
		</li>
	</ul>
</template>
<script>
	export default{
		props:{},
		data(){
			return {
				datalist:[
					{
						id:1,
						text:'Shandong'
					},
					{
						id:2,
						text:'Beijing'
					},
					{
						id:3,
						text:'Shaanxi'
					},
					{
						id:4,
						text:'Chongqing'
					}
				]
			}
		},
		components:{},
		methods:{},
		mounted(){},
		created(){},
		watch:{}
	}
</script>
<style scoped lang="scss">
	.container{
		display: flex;
		li{
			position: relative;
			width: 40px;
			height: 20px;
			font-size: 14px;
			font-weight: 300;
			text-align: center;
			line-height: 20px;
			span{
				display: inline-block;
				position: absolute;
				width: 1px;
				height: 50%;
				right: 0;
				top: 50%;
				transform: translateY(-50%);
				background-color: #EEEEEE;
			}
			&:last-child{ //Note here, the method to eliminate the last gray line span{
					width: 0;
				}
			}
		}
	}
</style>

You may also be interested in:
  • Detailed explanation of the use of router-view components in Vue
  • Detailed explanation of how to use Teleport, a built-in component of Vue3
  • A brief discussion on VUE uni-app custom components
  • A brief introduction to VUE uni-app basic components
  • A detailed discussion of components in Vue

<<:  Docker renames the image name and TAG operation

>>:  A brief analysis of SQL examples for finding uncommitted transactions in MySQL

Recommend

How to create https using nginx and Tencent Cloud free certificate

I have been studying how to get https. Recently I...

Detailed explanation of CSS line-height and height

Recently, when I was working on CSS interfaces, I...

XHTML introductory tutorial: Use of list tags

Lists are used to list a series of similar or rela...

How to restore a single database or table in MySQL and possible pitfalls

Preface: The most commonly used MySQL logical bac...

The best 9 foreign free picture material websites

It is difficult to find good image material websi...

Basic application methods of javascript embedded and external links

Table of contents Basic application of javascript...

JavaScript event loop case study

Event loop in js Because JavaScript is single-thr...

When you enter a URL, what exactly happens in the background?

As a software developer, you must have a complete...

An example of elegantly writing status labels in Vue background

Table of contents Preface optimization Extract va...