如何解决props vue js问题第二个元素不起作用
我添加了两个props组件,但是第一个组件可以工作,而第二个则不能。可能是什么问题。 VUE CLI。将来我需要传递10个以上的组件。我将非常感谢任何能为您提供帮助的人 主要组成部分:
<template>
<div id="app">
<app-select class="select"></app-select>
</div>
</template>
<script>
import Select from './components/Select.vue'
export default {
name: 'App',components: {
appSelect: Select
}
}
</script>
<style>
.select {
position: relative;
left: 100px;
top: 100px;
}
</style>
两个组成部分:
<template>
<div id="main">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
<slot>
<p class="article">{{ mainArticle }}</p>
<hr>
<hr>
<p class="price pol">{{ firstPLan }}</p>
</slot>
</div>
</template>
<script>
export default {
props: {
mainArticle: {
type: String,default: 'Choose your SIMM'
},firstPlan: {
default: '2GB'
}
}
}
</script>
屏幕问题:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。