当前位置: 首页 > news >正文

uniapp遇到的问题

【uniapp】小程序中input输入框的placeholder-class不生效解决办法

解决:写在scope外面

uniapp设置底部导航

引用:https://www.jianshu.com/p/738dd51a0162

【微信小程序】moveable-view / moveable-area的使用

https://blog.csdn.net/qq_36901092/article/details/130945111
https://uniapp.dcloud.net.cn/component/movable-view.html

uniapp设置全局样式

在这里插入图片描述

uniapp项目页面之间传值

onLoad(options){}中接收,,

uniapp路由拦截器
根目录,新建一个permission.jsimport { getToken } from '@/utils/auth'// 登录页面
const loginPage = "/pages/index"// 页面白名单
const whiteList = ['/pages/login', '/pages/register', '/pages/index'
]// 检查地址白名单
function checkWhite(url) {const path = url.split('?')[0]return whiteList.indexOf(path) !== -1
}// 页面跳转验证拦截器
let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]list.forEach(item => {uni.addInterceptor(item, {invoke(to) {if (getToken()) {if (to.url === loginPage) {uni.reLaunch({ url: "/" })}return true} else {if (checkWhite(to.url)) {return true}uni.showModal({title: "系统提示",content: "未登录,请先登录",confirmText:"去登录",success: function (res) {if (res.confirm) {uni.reLaunch({ url: '/pages/login' })}else if(res.cancel){uni.reLaunch({ url: '/pages/index' })}},})return false}},fail(err) {console.log(err)}})
})

引用:https://blog.csdn.net/weixin_70243424/article/details/133385536

uniapp中发送请求

uni.request() , 可以在外面 加一层promise
设置header,, 设置默认的header传输数据格式,,默认是

uniapp中使用vuex

引用:https://blog.csdn.net/Smile_666666/article/details/119735600
uniapp中自带vuex ,无需安装,,只需要创建一个js,/store/index.js

import Vue from 'vue'import Vuex from 'vuex'Vue.use(Vuex)const store = new Vuex.Store({state: {//公共的变量,这里的变量不能随便修改,只能通过触发mutations的方法才能改变},mutations: {//相当于同步的操作},actions: {//相当于异步的操作,不能直接改变state的值,只能通过触发mutations的方法才能改变}
})
export default store

main.js中导入vuex

import Vue from 'vue'
import App from './App'
import store from './pages/store/index.js'
Vue.prototype.$store = storeVue.config.productionTip = falseApp.mpType = 'app'const app = new Vue({store,...App
})
app.$mount()

使用:

  1. this.$store.state.user
  2. mapState, mapGetters mapActions mapMutations
<template><view class="content"></view>
</template><script>import { mapState, mapGetters, mapActions, mapMutations } from 'vuex'//导入export default {data() {return {}},computed: { //computed中注册...mapGetters(['text1']),...mapState(['text1'])}methods: {...mapMutations([]),...mapActions([])}}
</script><style>
</style>
uniapp中引入iconfont

引用:https://blog.csdn.net/qq_49002903/article/details/127445998

http://www.lryc.cn/news/318524.html

相关文章:

  • oppo前端开发一面
  • 案例分析篇09:Web架构设计相关20个考点(7~11)(2024年软考高级系统架构设计师冲刺知识点总结)
  • 为什么“玄学”与营销联系?媒介盒子分析
  • C++常用容器总结
  • C# Onnx C2PNet 图像去雾 室外场景
  • 【English Learning】Day13
  • 智障版本GPT3实现
  • 【ubuntu】安装 Anaconda3
  • 代码随想录|Day20|二叉树09|669. 修剪二叉搜索树、108.将有序数组转换为二叉搜索树、538.把二叉搜索树转换为累加树
  • 开源的java 代码分析库介绍
  • 基于udp协议的网络通信(windows客户端版+简易聊天室版),重定向到终端
  • Qt+FFmpeg+opengl从零制作视频播放器-7.OpenGL播放视频
  • 用两个栈实现简单的四则运算
  • <个人笔记>数论
  • CMS垃圾收集
  • Incorrect DECIMAL value: ‘0‘ for column ‘‘ at row -1
  • Vue3组件通信的方式
  • 双场板功率型GaN HEMT中用于精确开关行为的电容建模
  • UE4_AI_行为树_行为树快速入门指南
  • c++ 面试100个题目中的编程题目
  • C++初阶:类与对象(尾篇)
  • Spring状态机简单实现
  • WebServer -- 面试题(下)
  • 企业微信如何接入第三方应用?
  • JAVA后端编码的主键字段存储为什么倾向于使用雪花算法
  • Rust 深度学习库 Burn
  • C语言-存储期2.0
  • 计算机网络面经八股-HTTP请求报文和响应报文的格式?
  • Ubuntu 18.04安装最新版Visual Studio Code(VS Code)报依赖库版本过低错误
  • Android NDK入门:在应用中加入C和C++的力量