新建组建
<template>
<view>
<movable-area class="mymovable">
<movable-view direction="all" class="mymovableview"><view class="backMindex" @click="backMindex" draggable="true">返回首页</view></movable-view>
</movable-area>
</view>
</template>
<script>
export default {
data() {
return {};
},
methods: {
backMindex: function() {
uni.redirectTo({
url: '/pages/index/index'
});
}
}
};
</script>
<style>
.mymovable {
z-index: 90000000;
pointer-events: none;
height: 100%;
100%;
position: fixed;
left: 0px;
top: 0px;
}
.mymovableview {
pointer-events: auto;
140upx;
height: 140upx;
line-height: 140upx;
font-size: 24upx;
-webkit-border-radius: 140upx;
-moz-border-radius: 140upx;
border-radius: 140upx;
background: #fc5054;
color: #fff;
text-align: center;
top: auto;
left: auto;
bottom: 100upx;
right: 20upx;
-webkit-box-shadow: 2px 2px 2px #f2f2f2;
-moz-box-shadow: 2px 2px 2px #f2f2f2;
box-shadow: 2px 2px 2px #f2f2f2;
}
</style>
引用页面
<template>
<view>
<back-home></back-home>
</view>
</template>
<script>
import backHome from '../../components/back-home.vue';
export default {
components: {
backHome
}
}
</script>