2017-04-04 86 views
0
<div class="row rowpesquisa"> 
     <div class="col col-100 colpesquisatop"> 
     <div class="col col-25"> 
      <button class="button button-icon buttonsearch" ng-model="butpontoenc" ng-click="butpontoenc.clicked=!butpontoenc.clicked" ng-class="!butpontoenc.clicked?'button-tueddin':'button-tueddin'"> 
       <img src="img/pesquisar/[email protected]" ng-show="!butpontoenc.clicked"> 
       <img src="img/pesquisar/iconePontoDeEncontroverde.svg" ng-show="butpontoenc.clicked"> 
      </button> 
     </div> 
     <div class="col col-25"> 
      <button class="button button-icon buttonsearch" ng-model="butpessoas" ng-click="butpessoas.clicked=!butpessoas.clicked" ng-class="!butpessoas.clicked?'button-tueddin':'button-tueddin'"> 
       <img src="img/pesquisar/[email protected]" ng-show="!butpessoas.clicked"> 
       <img src="img/pesquisar/iconePessoasverde.svg" ng-show="butpessoas.clicked"> 
      </button> 
     </div> 
     <div class="col col-25"> 
      <button class="button button-icon buttonsearch" ng-model="butpontotur" ng-click="butpontotur.clicked=!butpontotur.clicked" ng-class="!butpontotur.clicked?'button-tueddin':'button-tueddin'"> 
       <img src="img/pesquisar/[email protected]" ng-show="!butpontotur.clicked"> 
       <img src="img/pesquisar/iconePontosTuristicosverde.svg" ng-show="butpontotur.clicked"> 
      </button> 
     </div> 
     <div class="col col-25"> 
      <button class="button button-icon buttonsearch" ng-model="butlocais" ng-click="butlocais.clicked=!butlocais.clicked" ng-class="!butlocais.clicked?'button-tueddin':'button-tueddin'"> 
       <img src="img/pesquisar/[email protected]" ng-show="!butlocais.clicked"> 
       <img src="img/pesquisar/iconeLocaisverde.svg" ng-show="butlocais.clicked"> 
      </button> 
     </div> 
     </div> 
    </div> 

所以這是我現在的代碼。這是一個搜索頁面,可以點擊4個按鈕,比如過濾器。但他們現在的工作方式是讓過濾器彼此總結。我需要選擇每個過濾器單獨顯示。爲此,我需要按鈕變成!單擊其他任何其他單擊時......我該怎麼做?我怎樣才能讓一個按鈕點擊,使其他按鈕!點擊離子V1?

謝謝

回答

0

你想讓這些工作像單選按鈕嗎?

簡單的解決方法是將它們設置爲false每次點擊所以你的第一個是這樣的:

ng-click="butpontoenc.clicked = true; butpessoas.clicked = false; butpontotur.clicked = false; butlocais.clicked = false;" 

您將需要複製該上的每個按鈕或創建需要在控制器上的方法在你想設置的按鈕中循環,並相應地設置每個按鈕。

+0

它工作正是我需要的,非常感謝你! 我不知道我可以使用「;」在同一個按鈕中編寫多個「單擊」執行。 – GustavoA

相關問題