border-style.uvue 2.2 KB
Newer Older
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
1
<template>
DCloud-WZF's avatar
DCloud-WZF 已提交
2 3 4 5 6 7 8 9
  <!-- #ifdef APP -->
  <scroll-view style="flex: 1">
    <!-- #endif -->
    <view style="flex-grow: 1">
      <view>
        <text>border-style: dashed</text>
        <view
          class="common"
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
10
          style="border-width: 5px; border-style: dashed"
DCloud-WZF's avatar
DCloud-WZF 已提交
11 12 13 14 15 16 17
        ></view>
      </view>

      <view>
        <text>border-left-style: dashed</text>
        <view
          class="common"
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
18
          style="border-left-width: 5px; border-left-style: dashed"
DCloud-WZF's avatar
DCloud-WZF 已提交
19 20
        ></view>
      </view>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
21

DCloud-WZF's avatar
DCloud-WZF 已提交
22 23 24 25
      <view>
        <text>border-top-style: dashed</text>
        <view
          class="common"
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
26
          style="border-top-width: 5px; border-top-style: dashed"
DCloud-WZF's avatar
DCloud-WZF 已提交
27 28
        ></view>
      </view>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
29

DCloud-WZF's avatar
DCloud-WZF 已提交
30 31 32 33
      <view>
        <text>border-right-style: dotted</text>
        <view
          class="common"
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
34
          style="border-right-width: 5px; border-right-style: dotted"
DCloud-WZF's avatar
DCloud-WZF 已提交
35 36 37 38 39 40 41
        ></view>
      </view>

      <view>
        <text>border-bottom-style: dotted</text>
        <view
          class="common"
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
42
          style="border-bottom-width: 5px; border-bottom-style: dotted"
DCloud-WZF's avatar
DCloud-WZF 已提交
43 44
        ></view>
      </view>
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

      <view>
        <text>border-style: solid (缺省 border-width)</text>
        <view
          class="common"
          style="border-style: solid;"
        ></view>
      </view>

      <view>
        <text>border-style: none</text>
        <view
          class="common"
          style="border-style: none; border-width: 5px;"
        ></view>
      </view>
DCloud_iOS_WZT's avatar
DCloud_iOS_WZT 已提交
61 62 63 64 65 66 67 68

      <view @click="changeBorderStyle">
        <text>border-style: 点击切换</text>
        <view
          class="common"
          :style="borderStyle"
        ></view>
      </view>
DCloud-WZF's avatar
DCloud-WZF 已提交
69 70 71 72 73
    </view>
    <!-- #ifdef APP -->
  </scroll-view>
  <!-- #endif -->
</template>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
74

DCloud_iOS_WZT's avatar
DCloud_iOS_WZT 已提交
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
<script>
	export default {
		data() {
			return {
        isSolid : false,
				borderStyle: "border-style: none; border-width: 5px;",
			}
		},
    methods: {
      changeBorderStyle() {
        this.isSolid = !this.isSolid;
        const solid = "border-style: solid; border-width: 5px;";
        const none = "";
        this.borderStyle = this.isSolid ? solid : none;
      }
    }
	}
</script>

DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
94
<style>
DCloud-WZF's avatar
DCloud-WZF 已提交
95
.common {
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
96 97
  width: 250px;
  height: 250px;
DCloud-WZF's avatar
DCloud-WZF 已提交
98 99 100
  background-color: gray;
}
</style>