为什么html页面不能显示标签el-checkbox的多选框,只有名称值

发布时间 2023-04-18 14:40:21作者: yesyes1

问题描述

我引入了el-checkbox之后,发现浏览器页面只是显示里面的文字,并没有显示出来我想要看到的相应样式

问题解决

经过一定的百度查证可知,使用Element-UI组件时,我们需要用div标签将其包裹起来;

然后使用script标签定义一下div里面的id属性,然后才能够引用到这个el-标签,让其中的样式显示出来!

在使用el-标签之前,我们要将这几条引用代码语句写入到文件里面:

<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>

<!-- import CSS -->
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">

然后进行引入运用就可以啦!