border-update.uvue 617 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <!-- #ifdef APP -->
  3. <scroll-view style="flex:1">
  4. <!-- #endif -->
  5. <view>
  6. <button @click="handleUpdate">点击更新border样式</button>
  7. <view class="border-view" :style="borderStyle"></view>
  8. </view>
  9. <!-- #ifdef APP -->
  10. </scroll-view>
  11. <!-- #endif -->
  12. </template>
  13. <script setup>
  14. let borderStyle = ref("border:3px solid red;")
  15. const handleUpdate = () => {
  16. borderStyle.value = "border:7px solid red;"
  17. }
  18. const jest_border_update = ()=>{
  19. handleUpdate()
  20. }
  21. defineExpose({
  22. jest_border_update
  23. })
  24. </script>
  25. <style>
  26. .border-view {
  27. width: 150px;
  28. height: 150px;
  29. }
  30. </style>