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

Diving into JS inheritance

Table of contents Preface Prepare Summarize n way...

Code comment writing standards during web page production

<br />I have summarized the annotation writi...

MySQL 5.7.33 installation process detailed illustration

Table of contents Installation package download I...

Detailed explanation of Vue3.0 + TypeScript + Vite first experience

Table of contents Project Creation Project Struct...

Detailed explanation of the abbreviation of state in react

Preface What is state We all say that React is a ...

JavaScript to achieve magnifying glass effect

This article shares the specific code for JavaScr...

Detailed usage of kubernetes object Volume

Overview Volume is the abstraction and virtualiza...

Vue3+script setup+ts+Vite+Volar project

Table of contents Create a vue + ts project using...

A Different Kind of "Cancel" Button

The “Cancel” button is not part of the necessary ...

MySQL 8.0.21.0 Community Edition Installation Tutorial (Detailed Illustrations)

1. Download MySQL Log in to the MySQL official we...

Install mysql 5.6 from yum source in centos7.4 system

System environment: centos7.4 1. Check whether th...

Use nginx + secondary domain name + https support

Step 1: Add a secondary domain name to the Alibab...

How to use JSX in Vue

What is JSX JSX is a syntax extension of Javascri...

Detailed explanation of the usage of Object.assign() in ES6

Table of contents 2. Purpose 2.1 Adding propertie...