vue 獲取單選框的值


html

      <div class="privacy">
            <input
              v-model="box"
              @change="getBox"
              class="checkbox"
              type="checkbox"
            />
            <span>用戶協議及隱私保護指引</span>
          </div>
css
   .privacy {
        font-size: calc(28vw / 11.25);
        width: calc(823vw / 11.25);
        height: calc(75vw / 11.25);
        text-align: center;
        margin-top: calc(19vw / 11.25);
        display: flex;
        justify-content: center;
        .checkbox {
          width: calc(40vw / 11.25);
          height: calc(40vw / 11.25);
          margin-right: calc(10vw / 11.25);
        }
      }
 
data
      box: false,
 
methods
getBox() {
      console.log(this.box);
    },
 
效果

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM