<input type=“checkbox“/>在页面不显示

283 阅读1分钟

问题阐述

type为checkbox的input写在.vue文件里,但在页面上不显示,检查发现就在页面上但是肉眼看不见(有默认大小)。。。将这行代码随便放到另一个项目的.html文件里又显示正常。

<input type="checkbox" />

解决方案

最后在.vue文件里给它加了样式正常显示

<template>
    <input  type="checkbox" class="checkbox-input" />
</template>

<style scoped>
    .checkbox-input {
        background-color: initial;
        cursor: default;
        appearance: checkbox;
        box-sizing: border-box;
        padding: initial;
        border: initial;
    }
</style>

最后

想请教一下大佬,这个具体原因是什么啊?在线等啊