border-update.uvue 535 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<template>
	<!-- #ifdef APP -->
	<scroll-view style="flex:1">
	<!-- #endif -->
		<view>
			<button @click="handleUpdate">点击更新border样式</button>
			<view class="border-view" :style="borderStyle"></view>
		</view>
	<!-- #ifdef APP -->
	</scroll-view>
	<!-- #endif -->
</template>

<script setup>
	let borderStyle = ref("border:3px solid red;")
	const handleUpdate = () => {
		borderStyle.value = "border:7px solid red;"
	}
</script>

<style>
	.border-view {
		width: 150px;
		height: 150px;
	}
</style>