vue报错解决方案 [Vue warn]: Invalid prop: type check failed for prop “width“. Expected Number w
组件1 helloword组件(默认页)<template><div class="hello"><el-menu :default-active="'2-1'" class="el-menu-demo"><el-col><el-menu-item index="1">处理中心</el-menu-item><el-sub
·
练习elementui时 写出的代码vue提示数据类型错误,得到的只有string类型的值,通过最后发现需要在el标签组件的元素前加" : "冒号
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<!-- 引入样式 -->
<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>
<style>
</style>
</head>
<body>
<div id="app">
<el-switch :v-model="value" :width=100 active-text="我是个伞兵!" inactive-text="我不是个伞兵"></el-switch>
<el-button @click="foolish"> 我宣布个事</el-button>
<el-slider :v-model="value1" :min="-100" :max="18" :show-input="true"></el-slider>
</div>
</body>
<script>
let vm = new Vue({
el: "#app",
data() {
return {
value: true,
value1: true,
};
},
methods: {
foolish(e) {
alert('我是个伞兵!');
this.value = !this.value;
console.log(e);
}
},
})
</script>
</html>
更多推荐
已为社区贡献1条内容
所有评论(0)