循环中中间有分隔符,单最后一个元素没有

<template>
	<div>
		<text
			class="design-text"
			v-for="(item, index) in model.design_position"
			:key="index"
		>
			{
    
    {
    
     item.name}}{
    
    {
    
     index == model.design_position.length - 1 ? '' : ' | ' }}
		</text>
	</div>
</template>

<script>
export default {
    
    i
	data() {
    
    
		return {
    
    
			model: {
    
    
				design_position: '',
			},
		};
	},
};
</script>

猜你喜欢

转载自blog.csdn.net/weixin_44696269/article/details/134257614