vue 自定義 移動端篩選條件

1.創建組件

components/FilterBar/FilterBar.vue

<template><div class="filterbar" :style="{'top': top + 'px'}"><div class="container"><div class="row"><divclass="col":class="{'selected': index == selectedIndexMenu}"@click="handleShowDialog(barMenu, index)"v-for="(barMenu, index) in barMenus":key="index">{{barMenu.name}}<span :class="index == selectedIndexMenu ? barMenu.selectIcon : barMenu.defaultIcon"></span></div></div><filter-bar-pop:filterTop="top":show-dialog="isShow":hasTabHeader="hasTabHeader":menu="selectedMenu"@changeTab="handleChangeTab"@changeMainItem="handleChangeMainItem"@changeSelect="changeSelect"@closeDialog="handleCloseDialog"></filter-bar-pop></div></div>
</template><script>import FilterBarPop from './FilterBarPop'export default {props: {barMenus: {type: Array,required: true,validator: function (value) {//TODO:驗證數據有效性return true;}},top: String},data() {return {isShow: false,hasTabHeader: false,selectedMenu: {},selectedIndexMenu: undefined}},methods: {handleShowDialog(menu, index) {this.isShow = true;this.selectedMenu = menu;this.selectedIndexMenu = index;if (menu.showTabHeader) {this.hasTabHeader = true;} else {this.hasTabHeader = false;}let _menu = JSON.parse(JSON.stringify(menu));_menu.tabs = {};this.$emit('showDialog', _menu);},handleChangeTab(tab) {this.$emit('changeTab', tab.index);},handleChangeMainItem(mainItem) {let _mainItem = JSON.parse(JSON.stringify(mainItem));this.$emit('changeMainItem', _mainItem);},handleCloseDialog() {this.isShow = false;this.selectedIndexMenu = -1;this.$emit('closeDialog');},changeSelect() {var selectData = [];this.barMenus.forEach(function (barMenu, index, arr) {let _selectBarData = {};// console.log("barMenu.name: " + barMenu.name);_selectBarData.name = barMenu.name;_selectBarData.value = barMenu.value;_selectBarData.tab = {};let tab = barMenu.tabs[barMenu.selectIndex];// console.log("tab.name: " + tab.name);_selectBarData.tab.name = tab.name;_selectBarData.tab.value = tab.value;let mainItem = tab.detailList[tab.selectIndex];_selectBarData.tab.mainItem = {}// console.log("mainItem.name: " + mainItem.name);_selectBarData.tab.mainItem.name = mainItem.name;_selectBarData.tab.mainItem.value = mainItem.vaule;let subItem = false;if (mainItem.list) {subItem = mainItem.list[mainItem.selectIndex];_selectBarData.tab.mainItem.subItem = {};// console.log("subItem.name: " + subItem.name);_selectBarData.tab.mainItem.subItem.name = subItem.name;_selectBarData.tab.mainItem.subItem.value = subItem.value;} else {_selectBarData.tab.mainItem.subItem = subItem;}selectData.push(_selectBarData);});this.$emit('changeSelect', selectData);}},components: {'filter-bar-pop': FilterBarPop}}
</script><style lang="scss">.filterbar {width: 100%;background: #fff;position: fixed;top: 0;left: 0;right: 0;.container {width: 100%;outline: 1px solid #DBDCDE;position: relative;.row {display: flex;display: -ms-flexbox;display: -moz-box;display: -webkit-box;display: -webkit-flex;flex-direction: row;-webkit-flex-direction: row;justify-content: space-around;-webkit-box-pack: space-around;-moz-box-pack: space-around;-ms-flex-pack: space-around;width: 90%;height: 40px;margin: 0 auto;line-height: 40px;.selected {color: orange;}.col {span {margin-left: 5px;vertical-align: middle;}}}}}
</style>

components/FilterBar/FilterBarPop.vue

<template><transition name="fade"><div class="filterbarpop-wrap" v-if="visible" :style="{'top': bgTop + 'px'}"><div class="filterbarpop-bg" @click="closeDialog" :style="{'top': bgTop + 'px'}"></div><div class="filterbarpop"><div class="tab-bar" v-show="hasTabHeader"><a href="javascript:;" :style="{'flex': column}" role="button" @click="clickTab(tab, index)" v-for="(tab, index) in menu.tabs":class="{'selected': selectIndexTab == index}"><span :class="tab.icon"></span>{{tab.name}}</a></div><div class="main"><div class="main-sidebar" :class="{'full-line': !items,'bg-style':items,'line-style':!items,}"><div v-if="menu.type !== 'filter'" class="item" @click="clickSidebar(sidemenu, index)" v-for="(sidemenu, index) in sideMenus.detailList":class="{'selected': currentSelectIndex == index}"><span :class="sidemenu.icon"></span>{{ sidemenu.name }}</div><div v-if="menu.type == 'filter'" v-for="(sm, _index) in menu.tabs"><div class="filter-name">{{sm.name}}</div><div class="filter-item"><span v-for="(sidemenu, index) in sm.detailList" class="item-operation" @click="clickFilterbar(sm, _index, index)" :class="{'multi-selected': sidemenu.selectIndex == index}">{{ sidemenu.name }}</span></div></div><div v-if="menu.type == 'filter'" class="filter-btns"><a href="javascript:;" role="button" @click="handleClean">取消</a><a href="javascript:;" role="button" @click="handleEnsure">確認</a></div></div><div class="main-list line-style" v-if="items"><span class="item" @click="clickItem(item, index)" v-for="(item, index) in items.list" :class="{'selected': currentSelectIndex == sideMenus.selectIndex && items.selectIndex == index}">{{item.name}}</span></div></div></div></div></transition>
</template><script>export default {props: {menu: {type: Object},showDialog: {type: Boolean,default: true},hasTabHeader: {type: Boolean,default: true},filterTop: {type: String}},data() {return {selectIndexTab: 0,currentSelectIndex: 0,sideMenus: {},items: {},column: '',visible: false,top: 1,bgTop: 0,range: {}}},mounted() {this.bgTop = document.querySelector('.filterbar').offsetHeight + this.filterTop / 1;},watch: {showDialog(v) {this.visible = v;if (v) {//初始化數據this.initData();}},menu(m) {//根據tabs數量計算列寬this.column = '0 0 ' + 100 / m.tabs.length + '%';//初始化數據this.initData();}},methods: {//初始化數據initData(tabIndex) {var tmpTabIndx = 0;tabIndex === undefined ? tmpTabIndx = this.menu.selectIndex : tmpTabIndx = tabIndex//判斷tabindex的范圍是否在數組內if (tmpTabIndx >= 0 && tmpTabIndx < this.menu.tabs.length) {this.selectIndexTab = tmpTabIndx;} else {this.selectIndexTab = 0;}//確認選中tab的一級列表this.sideMenus = this.menu.tabs[this.selectIndexTab];//如果當前選中tab是對應選中結果的tab// debugger;if (this.selectIndexTab == this.menu.selectIndex) {this.currentSelectIndex = this.sideMenus.selectIndex;}// else{//   this.sideMenus.selectIndex = -1;//   this.currentSelectIndex = -1;// }//判斷是否包含二級列表,包含則賦值//如果一級列表的選中狀態正確,則查詢二級列表if (this.currentSelectIndex >= 0 && this.currentSelectIndex < this.sideMenus.detailList.length) {//判斷是否有二級列表if (this.sideMenus.detailList[this.currentSelectIndex].list) {this.items = this.sideMenus.detailList[this.currentSelectIndex];} else {//不顯示二級列表this.items = false;}} else { //如果一級列表選中狀態不正確,按第一項的的數據判斷//判斷是否有二級列表if (this.sideMenus.detailList[0].list) {//顯示空的二級列表this.items = [];} else {//不顯示二級列表this.items = false;}}},//修改選項changeSelect(index) {//記錄tabIndexthis.menu.selectIndex = this.selectIndexTab;//記錄一級列表選項this.sideMenus.selectIndex = this.currentSelectIndex;if (this.items) {//確認二級列表選項this.items.selectIndex = index;//顯示名稱this.menu.name = this.items.list[this.items.selectIndex].name;this.menu.value = this.items.list[this.items.selectIndex].value;} else {//顯示名稱this.menu.name = this.sideMenus.detailList[this.sideMenus.selectIndex].name;this.menu.value = this.sideMenus.detailList[this.sideMenus.selectIndex].value;}this.$emit('changeSelect');this.closeDialog();},// 帥選修改選項changeRangeSelect() {this.menu.name = '篩選';for(var i in this.range){if(Object.keys(this.range[i].value).length == 0){delete this.range[i]}}this.menu.value = Object.keys(this.range).length > 0 ? this.range : '';this.$emit('changeSelect');this.closeDialog();},// 選擇Tab菜單clickTab(tab, index) {if (index !== this.selectIndexTab) {//根據選中的tab初始化數據this.initData(index);this.$emit('changeTab', {tab,index})}},// 篩選方法clickFilterbar(v, I, i) {v.detailList[i].selectIndex = i;// debuggerif(!this.range[I]){this.range[I] = {name: v.name, value: {}};this.range[I].value[i] = v.detailList[i].value;} else {if(!this.range[I].value[i]){this.range[I].value[i] = v.detailList[i].value;} else {delete this.range[I].value[i];v.detailList[i].selectIndex = -1;}}},// 點擊左側列表clickSidebar(v, i) {if (this.currentSelectIndex !== i) {this.currentSelectIndex = i;//存在二級列表if (this.sideMenus.detailList[this.currentSelectIndex].list) {this.items = this.sideMenus.detailList[this.currentSelectIndex];} else {//只有一級列表,記錄選項,退出this.changeSelect();}this.$emit('changeMainItem', {v,i});}},// 點擊右側列表clickItem(v, i) {//只有一級列表,記錄選項,退出this.changeSelect(i);},// 關閉彈框closeDialog() {this.visible = false;this.$emit('closeDialog');},// 提交已選內容handleEnsure() {this.changeRangeSelect();this.$emit('changeMainItem', this.range);// this.closeDialog();},// 清除已選內容handleClean() {this.menu.tabs.map(item => {item.detailList.map(_item => {_item.selectIndex = -1;})});this.range = {};}}}/**TODOS:1. 需要一個屬性去辨別帥選項2. 多選3. 添加多選框*/
</script><style lang="scss">.fade-enter-active,.fade-leave-active {transition: opacity .5s}.fade-enter,.fade-leave-active {opacity: 0}.filterbarpop-wrap {position: fixed;width: 100%;top: 0;bottom: 0;left: 0;overflow: hidden;max-height: 100%;.filterbarpop-bg {position: fixed;top: 0;bottom: 0;left: 0;width: 100%;background: rgba(0, 0, 0, .6);}.filterbarpop {position: absolute;width: 100%;border-top: 1px solid #ccc;.tab-bar {width: 100%;display: flex;display: -ms-flexbox;display: -moz-box;display: -webkit-box;display: -webkit-flex;flex-directives: row;-webkit-flex-direction: row;align-items: center;-webkit-align-items: center;-webkit-box-align: center;-moz-box-align: center;-ms-flex-align: center;height: 40px;.selected {border-bottom: 2px solid orange;box-sizing: border-box;}a {background: #fff;height: 100%;line-height: 40px;text-decoration: none;color: #323232;text-align: center;}}.main {display: flex;display: -webkit-flex;flex-direction: row;-webkit-flex-direction: row;height: 250px;background: #fff;.main-sidebar {flex: 0 0 50%;overflow: auto;width: 100%;}.full-line {flex: 0 0 100%;div {text-align: left; // text-indent: 1.5em;}}.item-operation {display: inline-block;padding: 10px 4px 10px 4px;border: 1px solid rgb(91, 149, 255);border-radius: 3px;height: 0;line-height: 1px;}.multi-selected {background: rgb(91, 149, 255);color: #fff !important;}.filter-item {border-top: 1px solid #ccc;border-bottom: 1px solid #ccc;padding: 13px 0 5px 10px;span {margin-right: 8px;margin-bottom: 8px;}}.filter-name {padding: 10px 0 10px 10px;}.filter-btns {display: flex;display: -webkit-flex;flex-direction: row;-webkit-flex-direction: row;justify-content: space-around;-webkit-box-pack: space-around;-moz-box-pack: space-around;-ms-flex-pack: space-around;position: absolute;bottom: -40px;width: 100%;line-height: 40px;z-index: 100;background: #fff;a {display: block;width: 100%;text-align: center;text-decoration: none;color: #ccc;border-top: 1px solid #ccc;&:last-child {background: #39f;color: #fff;}}}.main-list {flex: 0 0 50%;overflow: auto;span:active {background: #f5f5f5;}}.line-style {.item {text-align: left;margin-left: 10px;padding-left: 15px;border-bottom: 1px solid #ccc;position: relative;&.selected {color: orange;border-color: orange;span {color: orange;}}.checkbox {position: absolute;right: 50px;top: 10px;}}}.bg-style {.item {background-color: #f5f5f5;&.selected {background-color: #FFF;}}}.item {display: inline-block;height: 40px;background: #fff;line-height: 40px;width: 100%;text-decoration: none;color: #444;span {font-size: 14px;color: #888;margin-right: 10px;vertical-align: middle;}&:active {color: #fff;}}}}}
</style>

2.頁面調用

pages/FilterBarTest

<!-- 移動端篩選條件 測試頁 -->
<template><div><!-- 標題欄 --><x-header title="移動端篩選條件 測試頁"></x-header><!-- 內容部分 --><FilterBartop="40":barMenus="barMenus"@showDialog="handleShowDialog"@closeDialog="handleCloseDialog"@changeTab="handleChangeTab"@changeMainItem="handleChangeMainItem"@changeSelect="changeData"></FilterBar></div>
</template><script>import { XHeader } from 'vux'// 引入組件import FilterBar from '../../components/FilterBar/FilterBar.vue'// 引入假數據import barMenus from './data.js';export default {name: 'FilterBarTest',components: {XHeader,FilterBar,},data(){return {barMenus: barMenus}},methods: {handleShowDialog(v) {// console.log(v);},handleCloseDialog(v) {// console.log(v);},handleChangeTab(v) {// console.log(v);},handleChangeMainItem(v) {// console.log(v)},changeData(v) {console.log(v);}}}
</script><style lang="scss" scoped>//
</style>

data.js

export default [
{name: '附近',icon: '',value: 'area',showTabHeader: true,defaultIcon: '',selectIcon: '',selectIndex: 0,tabs: [{icon: '',name: '商圈',selectIndex: 0,detailList: [{name: '附近',icon: '',selectIndex: 0,list: [{name: '默認',value: 'all'}, {name: '500米',value: '500'}, {name: '1000米',value: '1000'}]},{name: '朝陽區',icon: '',selectIndex: 1,list: [{name: '全部',value: 'all'}, {name: '建國門',value: 'jianguomen'}, {name: '亞運村',value: 'yayuncun'}]},{name: '海淀區',icon: '',selectIndex: 2,list: [{name: '全部',value: 'all'}, {name: '中關村',value: 'zhongguancun'}, {name: '五道口',value: 'wudaokou'}]}]},{icon: '',name: '地鐵沿線',selectIndex: 1,detailList: [{name: '1號線',icon: '',selectIndex: 0,list: [{name: '平果圓',value: 'pingguoyuan'}, {name: '古城',value: 'gucheng'}, {name: '八角游樂園',value: 'bajiaoyouleyuan'}]},{name: '2號線',icon: '',selectIndex: 1,list: [{name: '積水潭',value: 'jishuitan'}, {name: '鼓樓大街',value: 'guloudajie'}, {name: '安定門',value: 'andingmen'}]},{name: '4號線',icon: '',selectIndex: 2,list: [{name: '安和橋北',value: 'anheqiaobei'}, {name: '北宮門',value: 'beigongmen'}, {name: '西宛',value: 'xiwan'}]}]}]
},
{name: '菜系',icon: '',value: 'food',showTabHeader: false,defaultIcon: '',selectIcon: '',selectIndex: 0,tabs: [{icon: '',name: '',selectIndex: 0,detailList: [{name: '全部',icon: '',value: '全部',selectIndex: 0,list: [{name: "全部",value: 'all'}]},{name: '中餐館',icon: '',value: '中餐館',selectIndex: 1,list: [{name: '全部',value: 'all'}, {name: '火鍋',value: 'hot pot'}, {name: '川菜',value: 'Sichuan cuisine'}]},{name: '西餐館',icon: '',value: '西餐管',selectIndex: 2,list: [{name: '全部',value: 'all'}, {name: '披薩',value: 'pizza'}, {name: '牛排',value: 'steak'}]}]}]
},
{name: '排序',icon: '',value: 'compositor',showTabHeader: false,defaultIcon: '',selectIcon: '',selectIndex: 0,tabs: [{icon: '',name: '',selectIndex: 0,detailList: [{name: '只能排序',icon: '',value: '0',selectIndex: 0},{name: '離我最近',icon: '',value: '1',selectIndex: 1},{name: '評價最好',icon: '',value: '2',selectIndex: 2}]}]
},
{name: '篩選',icon: '',value: 'filter',type: 'filter',showTabHeader: false,defaultIcon: '',selectIcon: '',selectIndex: 0,tabs: [{icon: '',name: '價格',selectIndex: 0,detailList: [{name: '0-50',value: '0-50',selectIndex: -1},{name: '50-100',value: '50-100',selectIndex: -1},{name: '100-150',value: '100-150',selectIndex: -1},{name: '150-200',value: '150-200',selectIndex: -1},{name: '200-250',value: '200-250',selectIndex: -1},{name: '300-350',value: '300-350',selectIndex: -1}]},{icon: '',name: '入住類型',selectIndex: 1,detailList: [{name: '不限',value: 'all',selectIndex: -1}, {name: '全日房',value: 'daily',selectIndex: -1}, {name: '鐘點房',value: 'time',selectIndex: -1},{name: '支持團購',value: 'group buy',selectIndex: -1}]}]
}]

3.效果圖

??

.

轉載于:https://www.cnblogs.com/crazycode2/p/8849448.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/390680.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/390680.shtml
英文地址,請注明出處:http://en.pswp.cn/news/390680.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

PSP

姓名&#xff1a;袁亞琴 日期&#xff1a;11月27日 教師&#xff1a;王建民 課程&#xff1a;PSP 項目計劃日志&#xff1a; PSP Planning . Estimate Development . Analysis . Design Spec . Design Review . …

如何在Windows中打開和使用命令提示符

入門 (Getting started) Windows, MacOS and Linux have command line interfaces. Windows’ default command line is the command prompt. The command prompt allows users to use their computer without pointing and clicking with a mouse. Windows&#xff0c;MacOS和…

ACM-ICPC北京賽區2017網絡同步賽H

http://hihocoder.com/contest/icpcbeijing2017/problem/8 預處理暴力枚舉修改的點 #include <bits/stdc.h> using namespace std; const int maxn 159; const int inf 0x3f3f3f3f; int a[maxn][maxn]; int colsum[maxn][maxn]; int rowsum[maxn][maxn]; int dp[maxn];…

PPPOE撥號上網流程及密碼竊取具體實現

樓主學生黨一枚&#xff0c;最近研究netkeeper有些許心得。 關于netkeeper是調用windows的rasdial來進行上網的東西&#xff0c;網上已經有一大堆&#xff0c;我就不贅述了。 本文主要講解rasdial的部分核心過程&#xff0c;以及我們可以利用它來干些什么。 netkeeper中rasdial…

leetcode 160. 相交鏈表(雙指針)

給你兩個單鏈表的頭節點 headA 和 headB &#xff0c;請你找出并返回兩個單鏈表相交的起始節點。如果兩個鏈表沒有交點&#xff0c;返回 null 。 圖示兩個鏈表在節點 c1 開始相交&#xff1a; 題目數據 保證 整個鏈式結構中不存在環。 注意&#xff0c;函數返回結果后&#…

android開發入門_Android開發入門

android開發入門Android is an open source, Linux-based mobile operating system. Android was developed by the Open Handset Alliance, which was lead by Google and featured contributions from many other companies.Android是基于Linux的開放源代碼移動操作系統。 An…

新購阿里云服務器ECS創建之后無法ssh連接的問題處理

作者&#xff1a;13 GitHub&#xff1a;https://github.com/ZHENFENG13 版權聲明&#xff1a;本文為原創文章&#xff0c;未經允許不得轉載。 問題描述 由于原服務器將要到期&#xff0c;因此趁著阿里云搞促銷活動重新購買了一臺ECS服務器&#xff0c;但是在初始化并啟動后卻無…

數據下發非標準用戶權限測試

與同事一起溝通了下MDM的Oracle權限部分: create user cx default tablespace cwbaseoe73 identified by Test6530 grant select,update,delete,insert on lcoe739999.lsbzdw to cx grant create table to cx alter user cx quota unlimited on cwbaseoe73 grant create sessio…

leetcode 474. 一和零(dp)

給你一個二進制字符串數組 strs 和兩個整數 m 和 n 。 請你找出并返回 strs 的最大子集的大小&#xff0c;該子集中 最多 有 m 個 0 和 n 個 1 。 如果 x 的所有元素也是 y 的元素&#xff0c;集合 x 是集合 y 的 子集 。 示例 1&#xff1a; 輸入&#xff1a;strs [“10”…

邊緣計算 ai_在邊緣探索AI!

邊緣計算 ai介紹 (Introduction) What is Edge (or Fog) Computing?什么是邊緣(或霧)計算&#xff1f; Gartner defines edge computing as: “a part of a distributed computing topology in which information processing is located close to the edge — where things a…

JavaScript中的全局變量介紹

Global variables are declared outside of a function for accessibility throughout the program, while local variables are stored within a function using var for use only within that function’s scope. If you declare a variable without using var, even if it’…

初識spring-boot

使用Spring或者SpringMVC的話依然有許多東西需要我們進行配置&#xff0c;這樣不僅徒增工作量而且在跨平臺部署時容易出問題。 使用Spring Boot可以讓我們快速創建一個基于Spring的項目&#xff0c;而讓這個Spring項目跑起來我們只需要很少的配置就可以了。Spring Boot主要有如…

leetcode 879. 盈利計劃(dp)

這是我參與更文挑戰的第9天 &#xff0c;活動詳情查看更文挑戰 題目 集團里有 n 名員工&#xff0c;他們可以完成各種各樣的工作創造利潤。 第 i 種工作會產生 profit[i] 的利潤&#xff0c;它要求 group[i] 名成員共同參與。如果成員參與了其中一項工作&#xff0c;就不能…

區塊鏈101:區塊鏈的應用和用例是什么?

區塊鏈技術是一場記錄系統的革命。 比特幣是歷史上第一個永久的、分散的、全球性的、無信任的記錄分類帳。自其發明以來&#xff0c;世界各地各行各業的企業家都開始明白這一發展的意義。 區塊鏈技術的本質讓人聯想到瘋狂&#xff0c;因為這個想法現在可以應用到任何值得信賴的…

java請求接口示例_用示例解釋Java接口

java請求接口示例介面 (Interfaces) Interface in Java is a bit like the Class, but with a significant difference: an interface can only have method signatures, fields and default methods. Since Java 8, you can also create default methods. In the next block y…

如何建立搜索引擎_如何建立搜尋引擎

如何建立搜索引擎This article outlines one of the most important search algorithms used today and demonstrates how to implement it in Python in just a few lines of code.本文概述了當今使用的最重要的搜索算法之一&#xff0c;并演示了如何僅用幾行代碼就可以在Pyth…

用Docker自動構建紙殼CMS

紙殼CMS可以運行在Docker上&#xff0c;接下來看看如何自動構建紙殼CMS的Docker Image。我們希望的是在代碼提交到GitHub以后&#xff0c;容器鏡像服務可以自動構建Docker Image&#xff0c;構建好以后&#xff0c;就可以直接拿這個Docker Image來運行了。 Dockerfile 最重要的…

Linux學習筆記15—RPM包的安裝OR源碼包的安裝

RPM安裝命令1、 安裝一個rpm包rpm –ivh 包名“-i” : 安裝的意思“-v” : 可視化“-h” : 顯示安裝進度另外在安裝一個rpm包時常用的附帶參數有&#xff1a;--force : 強制安裝&#xff0c;即使覆蓋屬于其他包的文件也要安裝--nodeps : 當要安裝的rpm包依賴其他包時&#xff0…

leetcode 518. 零錢兌換 II

給定不同面額的硬幣和一個總金額。寫出函數來計算可以湊成總金額的硬幣組合數。假設每一種面額的硬幣有無限個。 示例 1: 輸入: amount 5, coins [1, 2, 5] 輸出: 4 解釋: 有四種方式可以湊成總金額: 55 5221 52111 511111 示例 2: 輸入: amount 3, coins [2] 輸出: 0 解…

軟件測試中什么是正交實驗法_軟件工程中的正交性

軟件測試中什么是正交實驗法正交性 (Orthogonality) In software engineering, a system is considered orthogonal if changing one of its components changes the state of that component only. 在軟件工程中&#xff0c;如果更改系統的組件之一僅更改該組件的狀態&#xf…