首页  >  问答  >  正文

我想在 vuetify 中创建一个文本字段

https://i.stack.imgur.com/zbCfI.png

我想在vuetify中创建一个文本字段,但是按钮不能这样制作?还有高度,但它不能改变吗?我尝试了多次改变高度但不起作用

我已经有了 css,但很难在 vuetify 上使用

.parent-box{
  width:fit-content;
  background:#26376B;
}
.text-box{
  border:1px solid #CACACA;
  padding:5px 10px;
  min-width:300px;
}
.btn{
  padding:5px 20px;
  width:100px;
  color:#fff;
  border:none;
  background-color:#26376B;
  cursor:pointer;
}
.common{
  outline:none;
  border-radius:50px;
}

<div class="parent-box common">
  <input class="text-box common" type="text" placeholder="Chassis Number">
  <button class="btn common">Check</button>
</div>

P粉323224129P粉323224129236 天前421

全部回复(2)我来回复

  • P粉482108310

    P粉4821083102024-02-27 09:07:03

    类似的事情可以这样完成:

    ...
    
      
        
        
      
    
    
    ...
    
    

    看看这个CodePen

    许多样式都可以通过 props 在 vuetify 中自定义。但默认情况下,vuetify 受到 Material Design 的启发,与您的示例相反,自定义默认样式并不那么容易。对于您的情况,在使用此库之前应用一些 vuetify 主题可能会更好。

    回复
    0
  • P粉819937486

    P粉8199374862024-02-27 00:13:17

    问题陈述:想要在 Vuetify 中创建带有按钮的文本字段。

    解决方案:

    HTML:

    
    
      
      
        
      
           
            
        
          
      
      
    
    

    Vue.js:

    new Vue({
      el: "#app",
        vuetify: new Vuetify(),
      data: {
        input: ''
      },
      methods: {
        show(){
          alert(this.input)
        }
      }
    })
    

    输出:

    回复
    0
  • 取消回复