简介:
* 每个应用的退出功能,带模态弹窗,重新登录会跳转至相应应用首页,可直接复制
效果:
![](https://img.kancloud.cn/57/fc/57fcd864b0c7ec47d7ed004545eb6b78_340x207.png)
文件位置:
```
@/utils/user/isLogined.js
```
案例:
```
<!-- 退出登录 -->
<button class="cu-btn" @click="out">
退出登录
</button>
<!-- 模态弹窗 -->
<tui-modal :show="modal" @click="handleClick" title="提示" :content="modelContent"></tui-modal>
import {loginOut} from '@/utils/user/isLogined.js'
data () {
return {
modal:false,//模态弹窗状态
modelContent:'是否确定退出登录'
}
},
methods: {
out(){
this.modal = true
},
handleClick(e){
console.log(e);
if(e.index===1){
loginOut(this)
}else{
this.modal = false
}
}
}
```
参数:
| 参数 | 作用 | 类型 | 默认 | 是否必传 |
| --- | --- | --- | --- | --- |
| this | this对象 | Object | | true |
平台兼容性:
| android | H5 | IOS | 微信 | 百度 | 支付宝 | 字节跳动 |
| --- | --- | --- | --- | --- | --- | --- |
| √ | √ | 待测试 | 待测试 | 待测试 | 待测试 | 待测试 |
组件负责人:佘威