Vue : Select

和自甴很熟 提交于 2019-12-09 21:07:00

 

<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>

  

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!