uni-app常用代码

常用代码快


import {

mapState,

mapMutations

} from 'vuex'

var tool = require('../common/util.js')

navigateTo: function () {

uni.navigateTo({

url: 'navigator'

})

},

navigateBack: function () {

uni.navigateBack()

},

redirectTo: function () {

uni.redirectTo({

url: 'navigator'

})

}

uni.showModal({

title:"获取用户信息失败",

content:"错误原因"+e.detail.errMsg,

showCancel:false

});

uni.showModal({

    title: '提示',

    content: '这是一个模态弹窗',

    success: function (res) {

        if (res.confirm) {

            console.log('用户点击确定');

        } else if (res.cancel) {

            console.log('用户点击取消');

        }

    }

});

uni.showLoading({

title: '加载中'

});

setTimeout(function () {

uni.hideLoading();

}, 2000);

uni.showActionSheet({

itemList: ['A', 'B', 'C'],

success: function (res) {

console.log('选中了第' + (res.tapIndex + 1) + '个按钮');

},

fail: function (res) {

console.log(res.errMsg);

}

});







border-bottom:1px solid #c8c7cc70

页面代码块








你可能感兴趣的:(uni-app常用代码)