提交 143e0a92 编写于 作者: H hdx

feat(get-provider): 调整示例

上级 8f0bd60a
...@@ -4,12 +4,10 @@ ...@@ -4,12 +4,10 @@
<!-- #endif --> <!-- #endif -->
<view class="page"> <view class="page">
<page-head :title="title"></page-head> <page-head :title="title"></page-head>
<view>
<view class="service-item" v-for="(item, index) in serviceList" :key="index"> <view class="service-item" v-for="(item, index) in serviceList" :key="index">
<text class="item-k">{{item.name}}</text> <text class="service-name">{{item.name}}:</text>
<view class="item-v"> <view class="provider-list">
<text v-for="(item2, index2) in item.provider" :key="index2">{{item2}}</text> <text class="provider-item" v-for="(item2, index2) in item.provider" :key="index2">{{item2}}</text>
</view>
</view> </view>
</view> </view>
<button class="btn-get-provider" type="primary" @click="getProvider">getProvider</button> <button class="btn-get-provider" type="primary" @click="getProvider">getProvider</button>
...@@ -18,6 +16,7 @@ ...@@ -18,6 +16,7 @@
</scroll-view> </scroll-view>
<!-- #endif --> <!-- #endif -->
</template> </template>
<script> <script>
type ProviderItem = { type ProviderItem = {
service : string, service : string,
...@@ -50,7 +49,7 @@ ...@@ -50,7 +49,7 @@
}) })
}, },
updateProvider(service : string, provider : string[]) { updateProvider(service : string, provider : string[]) {
const item = this.serviceList.find((item : ProviderItem) => { const item : ProviderItem | null = this.serviceList.find((item : ProviderItem) : boolean => {
return item.service == service return item.service == service
}); });
if (item != null) { if (item != null) {
...@@ -66,16 +65,23 @@ ...@@ -66,16 +65,23 @@
padding: 15px; padding: 15px;
} }
.item-k { .service-item {
line-height: 2; margin-top: 10px;
} }
.item-v { .service-name {
font-weight: bold; font-weight: bold;
line-height: 2; }
.provider-list {
margin-left: 32px;
}
.provider-item {
line-height: 1.5;
} }
.btn-get-provider { .btn-get-provider {
margin-top: 50px; margin-top: 30px;
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册