1.首先在根目录中pages创建目录common,再创建您要引入的Vue页面,比如csdn.vue
2.在csdn.vue页面里您编写自己要开发的内容
根据自己的需求进行修改,我只是举例
<template>
<view class="content" >
<view class="biaoti">
CSND
</view>
</view>
</template>
<script>
export default {
data() {
return {
pmkuandu: '',pmgaodu: '',}
},onLoad() {
},methods: {
},}
</script>
<style>
.content{
background-color: darkcyan;
}
.biaoti{
color: #ff0000;
}
</style>
3.然后在index.vue页面进行引入
<template>
<view class="content">
</view>
<view class="csdn">
<csdn :style="{ height: pmgaodu + 'px',width: pmkuandu + 'px' }"></csdn>
</view>
</template>
<script>
import csdn from '/pages/common/csdn.vue'
export default {
components:{
csdn
},data() {
return {
}
},onLoad() {
},methods: {
}
}
</script>
<style>
.content {
z-index: 5;
position: relative;
}
.csdn {
display: flex;
z-index: 3;
position: fixed;
top: 0px;
margin-left: 0px;
}
</style>
原文地址:https://blog.csdn.net/weixin_54226053/article/details/132637515
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。