<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
<button @click='getserinfop'>登录</button>
<button open-type="getPhoneNumber" @getphonenumber='@getphonenumber'>登录</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
methods: {
getuserinfo(res) {
console.log(res);
},
getphonenumber(res) {
console.log(res);
},
getserinfop() {
uni.getUserProfile({
desc: '注册',
success: function(res) {
console.log(res);
},
fail: function(res) {
console.log(res);
}
})
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
- 发布:2022-05-05 20:10
- 更新:2022-05-05 21:57
- 阅读:206
产品分类: HbuilderX
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 10 专业版
HBuilderX版本号: 3.4.7
示例代码:
操作步骤:
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
<button @click='getserinfop'>登录</button>
<button open-type="getPhoneNumber" @getphonenumber='@getphonenumber'>登录</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
methods: {
getuserinfo(res) {
console.log(res);
},
getphonenumber(res) {
console.log(res);
},
getserinfop() {
uni.getUserProfile({
desc: '注册',
success: function(res) {
console.log(res);
},
fail: function(res) {
console.log(res);
}
})
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
<button @click='getserinfop'>登录</button>
<button open-type="getPhoneNumber" @getphonenumber='@getphonenumber'>登录</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
methods: {
getuserinfo(res) {
console.log(res);
},
getphonenumber(res) {
console.log(res);
},
getserinfop() {
uni.getUserProfile({
desc: '注册',
success: function(res) {
console.log(res);
},
fail: function(res) {
console.log(res);
}
})
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
预期结果:
括号应该正常闭合
括号应该正常闭合
实际结果:
括号闭合异常
括号闭合异常
bug描述:
在编辑vue代码的时候,js部分的括号闭合,错乱