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

MySQL column to row conversion and year-month grouping example

As shown below: SELECT count(DISTINCT(a.rect_id))...

HTML table tag tutorial (34): row span attribute ROWSPAN

In a complex table structure, some cells span mul...

Sample code for implementing interface signature with Vue+Springboot

1. Implementation ideas The purpose of interface ...

MySQL tutorial DML data manipulation language example detailed explanation

Table of contents 1. Data Manipulation Language (...

Docker custom network detailed introduction

Table of contents Docker custom network 1. Introd...

Detailed installation and use tutorial of mysql 8.0.15 under windows

This article shares with you the detailed install...

Example of how to deploy MySQL 8.0 using Docker

1. Refer to the official website to install docke...

Detailed explanation of MySQL remote connection permission

1. Log in to MySQL database mysql -u root -p View...

Detailed explanation of how to use grep to obtain MySQL error log information

To facilitate the maintenance of MySQL, a script ...

Vue data two-way binding implementation method

Table of contents 1. Introduction 2. Code Impleme...

Vue achieves the top effect through v-show

html <div class="totop" v-show="...

Common shell script commands and related knowledge under Linux

Table of contents 1. Some points to remember 1. V...

MySQL Billions of Data Import, Export and Migration Notes

I have been taking a lot of MySQL notes recently,...