| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 | <template>		<view>		<view class="u-index-anchor-wrapper" :id="$u.guid()" :style="[wrapperStyle]">			<view class="u-index-anchor " :class="[active ? 'u-index-anchor--active' : '']" :style="[customAnchorStyle]">				<slot v-if="useSlot" />				<block v-else>					<text>{{ index }}</text>				</block>			</view>		</view>	</view></template><script>		export default {		name: "u-index-anchor",		props: {			useSlot: {				type: Boolean,				default: false			},			index: {				type: String,				default: ''			},			customStyle: {				type: Object,				default () {					return {}				}			}		},		data() {			return {				active: false,				wrapperStyle: {},				anchorStyle: {}			}		},		created() {			this.parent = false;		},		mounted() {			this.parent = this.$u.$parent.call(this, 'u-index-list');			if(this.parent) {				this.parent.children.push(this);				this.parent.updateData();			}		},		computed: {			customAnchorStyle() {				return Object.assign(this.anchorStyle, this.customStyle);			}		}	}</script><style lang="scss" scoped>	@import "../../libs/css/style.components.scss";		.u-index-anchor {		box-sizing: border-box;		padding: 14rpx 24rpx;		color: #606266;		width: 100%;		font-weight: 500;		font-size: 28rpx;		line-height: 1.2;		background-color: rgb(245, 245, 245);	}	.u-index-anchor--active {		right: 0;		left: 0;		color: #2979ff;		background-color: #fff;	}</style>
 |