Commit 82db6570 authored by wlxuqu's avatar wlxuqu

nvue调整

parent 6da64e23
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/uview-ui/libs/css/style.components.scss";
.nav-wrap { .nav-wrap {
padding: 30rpx; padding: 30rpx;
position: relative; position: relative;
...@@ -59,8 +58,7 @@ ...@@ -59,8 +58,7 @@
} }
.nav-title { .nav-title {
@include vue-flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
} }
...@@ -69,7 +67,7 @@ ...@@ -69,7 +67,7 @@
} }
.nav-title__text { .nav-title__text {
@include vue-flex; display: flex;
color: $u-main-color; color: $u-main-color;
font-size: 50rpx; font-size: 50rpx;
font-weight: bold; font-weight: bold;
......
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
// 定义nvue页面的flex布局默认为row排列
"nvue ": {
"flex-direction": "row"
},
// APP-VUE分包,可提APP升启动速度,2.7.12开始支持,兼容微信小程序分包方案,默认关闭 // APP-VUE分包,可提APP升启动速度,2.7.12开始支持,兼容微信小程序分包方案,默认关闭
"optimization" : { "optimization" : {
"subPackages" : true "subPackages" : true
......
<template>
<view class="">
<u-dropdown ref="uDropdown" @open="open" @close="close">
<u-dropdown-item v-model="value1" title="距离" :options="options1" @change="change"></u-dropdown-item>
<u-dropdown-item v-model="value2" title="温度" :options="options2"></u-dropdown-item>
</u-dropdown>
</view>
</template>
<script>
export default {
data() {
return {
value1: 1,
value2: 2,
options1: [{
label: '默认排序',
value: 1,
},
{
label: '距离优先',
value: 2,
}
],
options2: [{
label: '去冰',
value: 1,
},
{
label: '加冰',
value: 2,
},
],
}
},
methods: {
open(index) {
// 展开某个下来菜单时,先关闭原来的其他菜单高亮
// 同时内部会自动给当前展开项进行高亮
this.$refs.uDropdown.highlight();
},
close(index) {
// 关闭的时候,给当前项加上高亮
// 当然,您也可以通过监听dropdown-item的@change事件进行处理
this.$refs.uDropdown.highlight(index);
},
change() {
// 更多的细节,请自行实现
}
}
}
</script>
\ No newline at end of file
<template>
<view class="wrap">
<page-nav :desc="desc" title="nav.components"></page-nav>
<view class="list-wrap">
<u-cell-group title-bg-color="rgb(243, 244, 246)" :title="getGroupTitle(item)" v-for="(item, index) in list" :key="index">
<u-cell-item :titleStyle="{fontWeight: 500}" @click="openPage(item1.path)" :title="getFieldTitle(item1)"
v-for="(item1, index1) in item.list" :key="index1">
<image slot="icon" class="u-cell-icon" :src="getIcon(item1.icon)" mode="widthFix"></image>
</u-cell-item>
</u-cell-group>
</view>
<u-gap height="70"></u-gap>
<u-tabbar :list="vuex_tabbar" :mid-button="true"></u-tabbar>
</view>
</template>
<script>
import list from "./components.config.js";
export default {
data() {
return {
list: list,
//desc: '众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让你快速集成,开箱即用。',
}
},
computed: {
getIcon() {
return path => {
return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
}
},
desc() {
return this.$t('components.desc');
}
},
onShow() {
uni.setNavigationBarTitle({
title: this.$t('nav.components')
});
},
created() {
},
methods: {
openPage(path) {
this.$u.route({
url: path
})
},
getGroupTitle(item) {
return this.$i18n.locale == 'zh' ? item.groupName : item.groupName_en
},
getFieldTitle(item) {
return this.$i18n.locale == 'zh' ? item.title : item.title_en
}
}
}
</script>
<style>
/* page {
background-color: rgb(240, 242, 244);
} */
</style>
<style lang="scss" scoped>
.u-cell-icon {
width: 36rpx;
height: 36rpx;
margin-right: 8rpx;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment