Vue : Select

 

<template>
    <div>
        <select v-model="mychoice">
            <option value="html">HTML</option>
            <option value="css">CSS</option>
            <option value="js">JS</option>
        </select>
        <p>Your choise is: <b>{{mychoice}}</b></p>

    </div>

</template>

<script>
    export default  {    
        data:function(){
            return{
                mychoice:''
            }
        }
    }
</script>

<style>
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: url(./arrow.png) no-repeat;
    background-position-x: 99%;
    background-position-y: 50%;
    background-size: 15px;
    border:1px solid #E0E0E0;
    position: relative;
    height:25px;
    width:50%;
    text-align-last: left;
    left:24%;
}
p {
    margin-top:8px;
    position: relative;
    width:50%;
    text-align: center;
    left:24%;
}
</style>

  

posted @ 2019-12-09 20:53  coshaho  阅读(294)  评论(0编辑  收藏  举报