|
| 1 | +<template> |
| 2 | + <div class="ui-cnt"> |
| 3 | + <div class="item"> |
| 4 | + <div class="title">wx-button</div> |
| 5 | + <div class="comp-cnt"> |
| 6 | + <wx-button class="wx-button" type="primary">页面主操作 Normal</wx-button> |
| 7 | + <wx-button class="wx-button" type="primary" :loading="true">页面主操作 Loading</wx-button> |
| 8 | + <wx-button class="wx-button" type="primary" :disabled="true">页面主操作 Disabled</wx-button> |
| 9 | + <wx-button class="wx-button" type="default">页面次要操作 Normal</wx-button> |
| 10 | + <wx-button class="wx-button" type="default" :disabled="true">页面次要操作 Disabled</wx-button> |
| 11 | + <wx-button class="wx-button" type="warn">警告类操作 Normal</wx-button> |
| 12 | + <wx-button class="wx-button" type="warn" :disabled="true">警告类操作 Disabled</wx-button> |
| 13 | + <wx-button class="wx-button" type="primary" :plain="true">按钮</wx-button> |
| 14 | + <wx-button class="wx-button" type="primary" :disabled="true" :plain="true">不可点击的按钮</wx-button> |
| 15 | + <wx-button class="wx-button" type="default" :plain="true">按钮</wx-button> |
| 16 | + <wx-button class="wx-button" type="default" :disabled="true" :plain="true">按钮</wx-button> |
| 17 | + <div> |
| 18 | + <wx-button class="wx-button mini-btn" type="primary" size="mini">按钮</wx-button> |
| 19 | + <wx-button class="wx-button mini-btn" type="default" size="mini">按钮</wx-button> |
| 20 | + <wx-button class="wx-button mini-btn" type="warn" size="mini">按钮</wx-button> |
| 21 | + </div> |
| 22 | + </div> |
| 23 | + </div> |
| 24 | + <div class="item"> |
| 25 | + <div class="title"></div> |
| 26 | + <div class="comp-cnt"> |
| 27 | + <wx-scroll-view |
| 28 | + ref="wx-scroll-view" |
| 29 | + class="wx-scroll-view" |
| 30 | + :scroll-y="true" |
| 31 | + :scroll-with-animation="true" |
| 32 | + > |
| 33 | + <div> |
| 34 | + <div id="block1" class="block block1"></div> |
| 35 | + <div id="block2" class="block block2"></div> |
| 36 | + <div id="block3" class="block block3"></div> |
| 37 | + <div id="block4" class="block block4"></div> |
| 38 | + <div id="block5" class="block block5"></div> |
| 39 | + </div> |
| 40 | + </wx-scroll-view> |
| 41 | + <div class="opr-cnt opr-cnt-y"> |
| 42 | + <wx-button class="wx-button opr-button" @click="setAttribute('wx-scroll-view', 'scroll-into-view', 'block3')">滑动到第三个</wx-button> |
| 43 | + <wx-button class="wx-button opr-button" @click="setAttribute('wx-scroll-view', 'scroll-top', 120)">滚动到 120px 处</wx-button> |
| 44 | + </div> |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + <div class="item"> |
| 48 | + <div class="title">mp-msg</div> |
| 49 | + <div class="comp-cnt"> |
| 50 | + <mp-msg type="success" title="操作成功"> |
| 51 | + <div slot="desc">内容详情,可根据实际需要安排,如果换行则不超过规定长度,居中展现</div> |
| 52 | + <div slot="extend"> |
| 53 | + <div>1. 说明1</div> |
| 54 | + <div>2. 说明2</div> |
| 55 | + </div> |
| 56 | + <div slot="handle" style="margin: 0 20px"> |
| 57 | + <wx-button class="wx-button" type="primary">主要操作</wx-button> |
| 58 | + <wx-button class="wx-button" type="default">辅助操作</wx-button> |
| 59 | + </div> |
| 60 | + </mp-msg> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | +</template> |
| 65 | + |
| 66 | +<script> |
| 67 | +export default { |
| 68 | + name: 'KboneUI', |
| 69 | + methods: { |
| 70 | + setAttribute(ref, name, value) { |
| 71 | + this.$refs[ref].setAttribute(name, value) |
| 72 | + }, |
| 73 | + } |
| 74 | +} |
| 75 | +</script> |
| 76 | + |
| 77 | +<style lang="less"> |
| 78 | +.ui-cnt { |
| 79 | + margin: 30px; |
| 80 | +} |
| 81 | +@media (prefers-color-scheme: dark) { |
| 82 | + html { |
| 83 | + background-color: #222; |
| 84 | + color: #fff; |
| 85 | + } |
| 86 | + .title { |
| 87 | + color: #000; |
| 88 | + } |
| 89 | +} |
| 90 | +.title { |
| 91 | + height: 40px; |
| 92 | + line-height: 40px; |
| 93 | + font-size: 16px; |
| 94 | + background-color: #b8e8ab; |
| 95 | + padding-left: 20px; |
| 96 | +} |
| 97 | +.comp-cnt { |
| 98 | + padding: 10px; |
| 99 | +} |
| 100 | +.wx-button { |
| 101 | + margin-bottom: 10px; |
| 102 | +} |
| 103 | +.mini-btn { |
| 104 | + margin-right: 10px; |
| 105 | +} |
| 106 | +.wx-scroll-view { |
| 107 | + width: 100%; |
| 108 | + height: 125px; |
| 109 | +} |
| 110 | +.block { |
| 111 | + width: 100%; |
| 112 | + height: 50px; |
| 113 | +} |
| 114 | +.block1 { |
| 115 | + background: #dff0d8; |
| 116 | +} |
| 117 | +.block2 { |
| 118 | + background: #f5f5f5; |
| 119 | +} |
| 120 | +.block3 { |
| 121 | + background: #d9edf7; |
| 122 | +} |
| 123 | +.block4 { |
| 124 | + background: #fcf8e3; |
| 125 | +} |
| 126 | +.block5 { |
| 127 | + background: #f2dede; |
| 128 | +} |
| 129 | +.opr-cnt { |
| 130 | + margin: 10px; |
| 131 | + display: flex; |
| 132 | + flex-wrap: wrap; |
| 133 | + align-items: center; |
| 134 | +} |
| 135 | +.opr-button { |
| 136 | + margin: 0 10px 10px; |
| 137 | +} |
| 138 | +</style> |
0 commit comments